Reputation: 1441
in fields_for
when i add :class=>"street"
to text_field
it works fine, where as
when i add :class=>"zip"
to select it is triggring error
<%= form_for @person do |person_form| %>
<%= person_form.fields_for :address do |address_fields| %>
Street : <%= address_fields.text_field :street, :class=>"street" %>
Zip code: <%= address_fields.select :zip_code, :class=>"zip", options_for_select(@zip.to_a) %>
<% end %>
<% end %>
please, help to solve the issue
thanks
Upvotes: 1
Views: 1098
Reputation: 432
Try using:
Zip code: <%= address_fields.select :zip_code, options_for_select(@zip.to_a),:class=>"zip" %>
Upvotes: 0