1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Select missing formbuilder typo.

This commit is contained in:
Dan Patrick 2012-07-08 19:53:02 -05:00
parent 3cebfa49e1
commit bf97795e73

View file

@ -442,7 +442,7 @@ In most cases form controls will be tied to a specific database model and as you
<erb>
# view:
<%= select(:person, :city_id, [['Lisbon', 1], ['Madrid', 2], ...]) %>
<%= f.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.