RailsCasts Pro episodes are now free!

Learn more or hide this

alfredmey's Profile

GitHub User: alfredmey

Comments by

Avatar

First Off this this a very good tutorial. But i am having some Issues with the select fields and they are not being populated correctly on the nested fields

One of my nested Form Fields:

If i do this i get the year correctly and populated

<%= f.text_field :year %>

But what do i pass in this select field to populate the correct year.

I know it will be a second input in the option_for_select but how to i get the object that is being inputed

f.year Does Not Work..

<%= f.select :year, options_for_select((1900..Date.today.year+1).to_a.reverse), {:prompt => 'Year', :class=>"pointer" } %>