07 Oct '13, 3am

Very useful rails array helper method I learned about today: in_groups_of. very cool.

Returns a string that represents the array in XML by invoking to_xml on each element. Active Record collections delegate their representation in XML to this method. All elements are expected to respond to to_xml , if any of them does not then an exception is raised. The root node reflects the class name of the first element in plural if all elements belong to the same type and that’s not Hash: customer.projects.to_xml <?xml version="1.0" encoding="UTF-8"?> <projects type="array"> <project> <amount type="decimal">20000.0</amount> <customer-id type="integer">1567</customer-id> <deal-date type="date">2008-04-09</deal-date> ... </project> <project> <amount type="decimal">57230.0</amount> <customer-id type="integer">1567</customer-id> <deal-date type="date">2008-04-15</deal-date> ... </project> </projects> Otherwise the root element is “objects”: [{ foo: 1, bar: 2}, { baz: 3}]....

Full article: http://api.rubyonrails.org/classes/Array.html#method-i-in...

Tweets

Solar Array Tracker (Part 1): SunSeeker Hardware with chipKIT Max32 | Circuit Cellar

Solar Array Tracker (Part 1): SunSeeker Hardwar...

circuitcellar.com 06 Oct '13, 8pm

Figure 1: These are the H-bridge motor drivers and sensor input conditioning circuits. Most of the discrete components are...

ActiveSupport::PerThreadRegistry seems useful:

api.rubyonrails.org 08 Oct '13, 7pm

This module is used to encapsulate access to thread local variables. Instead of polluting the thread locals namespace: Thr...

New Camp Twin Lakes Treehouse Outfitted with Solar Array, Green Roof @jetsongreenさんから

New Camp Twin Lakes Treehouse Outfitted with So...

jetsongreen.com 06 Oct '13, 2pm

Kids with special illnesses, disabilities, and other challenges received a new toy this summer at Camp Twin Lakes in Rutle...