Permalink
Browse files

find :all -> .all

  • Loading branch information...
1 parent bf26f42 commit 13e4b02a5c603b9368448febe09254e2b2dcbc1a @fcheung fcheung committed Jan 25, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/doc/guides/source/form_helpers.txt
@@ -453,7 +453,7 @@ Option tags from a collection of arbitrary objects
Generating options tags with `options_for_select` requires that you create an array containing the text and value for each option. But what if you had a City model (perhaps an Active Record one) and you wanted to generate option tags from a collection of those objects? One solution would be to make a nested array by iterating over them:
----------------------------------------------------------------------------
-<% cities_array = City.find(:all).map { |city| [city.name, city.id] } %>
+<% cities_array = City.all.map { |city| [city.name, city.id] } %>
<%= options_for_select(cities_array) %>
----------------------------------------------------------------------------

0 comments on commit 13e4b02

Please sign in to comment.