From 13e4b02a5c603b9368448febe09254e2b2dcbc1a Mon Sep 17 00:00:00 2001 From: Frederick Cheung Date: Sun, 25 Jan 2009 12:31:46 +0000 Subject: find :all -> .all --- railties/doc/guides/source/form_helpers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/doc/guides') diff --git a/railties/doc/guides/source/form_helpers.txt b/railties/doc/guides/source/form_helpers.txt index 055dc20553..a17c7e5249 100644 --- a/railties/doc/guides/source/form_helpers.txt +++ b/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) %> ---------------------------------------------------------------------------- -- cgit v1.2.3