Browse files

Revert "Select missing formbuilder typo."

This reverts commit bf97795.
  • Loading branch information...
1 parent bf97795 commit 8139daa77bbf0d66dc78587d8e8871fcf7ca87bb @mdpatrick mdpatrick committed Jul 9, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 guides/source/form_helpers.textile
View
4 guides/source/form_helpers.textile
@@ -442,7 +442,7 @@ In most cases form controls will be tied to a specific database model and as you
<erb>
# view:
-<%= f.select(:person, :city_id, [['Lisbon', 1], ['Madrid', 2], ...]) %>
+<%= select(:person, :city_id, [['Lisbon', 1], ['Madrid', 2], ...]) %>
</erb>
Notice that the third parameter, the options array, is the same kind of argument you pass to +options_for_select+. One advantage here is that you don't have to worry about pre-selecting the correct city if the user already has one -- Rails will do this for you by reading from the +@person.city_id+ attribute.
@@ -942,4 +942,4 @@ As a convenience you can instead pass the symbol +:all_blank+ which will create
h4. Adding Fields on the Fly
-Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new child' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the the key of the associated array is unique - the current javascript date (milliseconds after the epoch) is a common choice.
+Rather than rendering multiple sets of fields ahead of time you may wish to add them only when a user clicks on an 'Add new child' button. Rails does not provide any builtin support for this. When generating new sets of fields you must ensure the the key of the associated array is unique - the current javascript date (milliseconds after the epoch) is a common choice.

0 comments on commit 8139daa

Please sign in to comment.