Skip to content
This repository
Browse code

Revert "Select missing formbuilder typo."

This reverts commit bf97795.
  • Loading branch information...
commit 8139daa77bbf0d66dc78587d8e8871fcf7ca87bb 1 parent bf97795
Dan Patrick mdpatrick authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 guides/source/form_helpers.textile
4 guides/source/form_helpers.textile
Source Rendered
@@ -442,7 +442,7 @@ In most cases form controls will be tied to a specific database model and as you
442 442
443 443 <erb>
444 444 # view:
445   -<%= f.select(:person, :city_id, [['Lisbon', 1], ['Madrid', 2], ...]) %>
  445 +<%= select(:person, :city_id, [['Lisbon', 1], ['Madrid', 2], ...]) %>
446 446 </erb>
447 447
448 448 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
942 942
943 943 h4. Adding Fields on the Fly
944 944
945   -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.
  945 +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.
Something went wrong with that request. Please try again.