I have written this line in my show.html.erb of Person model.
<%= f.simple_fields_for :holidays do |holiday| %>
<%= holiday.input :number,
:label => holiday.day.name,
:input_html=>{
:required => false
} %>
I have two questions :
1. What does holiday mean here. I mean what does it contain?
2. :label => holiday.day.name line gives an error => undefined method day.
There is a join table holidays which contains (person_id, day_id, number).
holidayis form builder object.To get the object which is wrapped inside a form builder object, you need to call the
objectmethod on it. The below will work.