29 Dec '13, 5am

@lizuselton Rails tries to be really (sometimes excessively) smart about that kind of thing.

Creates a Cycle object whose to_s method cycles through elements of an array every time it is called. This can be used for example, to alternate classes for table rows. You can use named cycles to allow nesting in loops. Passing a Hash as the last parameter with a :name key will create a named cycle. The default name for a cycle without a :name key is "default" . You can manually reset a cycle by calling #reset_cycle and passing the name of the cycle. The current cycle string can be obtained anytime using the #current_cycle method. # Alternate CSS classes for even and odd numbers... @items = [1,2,3,4] <table> <% @items.each do |item| %> <tr class="<%= cycle("odd", "even") -%>"> <td>item</td> </tr> <% end %> </table> # Cycle CSS classes for rows, and text colors for values within each row @items = x = [{first: 'Robert', middle: 'Daniel', last: 'James'}, {first: 'Emily', mid...

Full article: http://api.rubyonrails.org/classes/ActionView/Helpers/Tex...

Tweets

@lizuselton Rails tries to be really (sometimes...

api.rubyonrails.org 29 Dec '13, 5am

The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones withou...

Dog Center Europe treats soldiers — the canine ...

stripes.com 26 Dec '13, 5pm

View Photo Gallery » Spc. Michael Plemmons, an infantryman and Tactical Explosives Detection Dog handler, carries his dog,...

Kind of feel the tag cloud in Google Analytics ...

davidnaylor.co.uk 28 Dec '13, 1am

Kind of feel the tag cloud in Google Analytics is a bit pointless now… by David Whitehouse 19 December 2013 2 Comments htt...

Why eating breakfast is a really good idea

Why eating breakfast is a really good idea

treehugger.com 27 Dec '13, 1pm

of Type 2 diabetes and cardiovascular disease, according to Dr. Mark Pereira of Harvard Medical School. A study in the the...

Rails Associations With Multiple Foreign Keys -...

pivotallabs.com 26 Dec '13, 4am

Recently we had a situation where we inherited a schema and two of the models were joined using multiple foreign keys. The...

Chameleon Emulates Contactless Smart Cards

Chameleon Emulates Contactless Smart Cards

hackaday.com 28 Dec '13, 9pm

Researchers at Ruhr University of Bochum in Germany have been busy working with RFID and related devices for quite some ti...

New toy, nice eggs and that glowing thing

New toy, nice eggs and that glowing thing

smashpop.net 29 Dec '13, 4am

New toy, nice eggs and that glowing thing POPCRAP 1 If you are not aware yet, I have been spending quite some time with my...

#SEO Alert! #Google: Our #Algorithms Really Are...

seroundtable.com 25 Dec '13, 4pm

About a month ago, we reported that Googlers indeed know if a site is impacted by an algorithm or not - not just if a site...

A single Engineer, Rails, 10 Mil pageviews/day....

railsinside.com 28 Dec '13, 1pm

is an online knitting and crochet community run by husband and wife team Casey and Jessica Forbes. A few weeks ago they di...

Smart is at a whole new level for homes: Smart homes have gone to a whole new level with Panasonic's showcase

Smart is at a whole new level for homes: Smart ...

enn.com 28 Dec '13, 2pm

Smart homes have gone to a whole new level with Panasonic's showcase center in Tokyo, Japan. Panasonic's new technologies ...

Sometimes a Wild God ... a mysterious guest arrives at the dinner table -- The Ecologist

Sometimes a Wild God ... a mysterious guest arr...

theecologist.org 25 Dec '13, 8am

Sometimes a wild god comes to the table. He is awkward and does not know the ways Of porcelain, of fork and mustard and si...

Here's why turning off the lights really does make a difference

Here's why turning off the lights really does m...

treehugger.com 27 Dec '13, 7pm

From my rambings on why green lifestyle choices won't save us to the meteorologist who broke down over climate change and ...

Would you #wear #smart #socks if they could prevent #injuries? #technology .@Heapsylon #wearabletechnology

Would you #wear #smart #socks if they could pre...

electronicproducts.com 27 Dec '13, 6pm

activity tracker, people appear to love the trend of wearable technology . These gadgets are fashionable, functional, and...

#Rails 4.1 beta1 now available!

rubyflow.com 25 Dec '13, 9pm

Rails 4.1 beta1 now available Posted by kalv on December 18, 2013 — 0 comments Rails 4.1 beta has been released just in ti...

Bit Stew: The Operations Platform for the Smart Grid?

Bit Stew: The Operations Platform for the Smart...

greentechmedia.com 19 Dec '13, 5pm

Consider a typical advanced metering infrastructure (AMI) network -- millions of smart meters, each containing multiple ha...