I have a nested form in which a select drop down works fine for creating the model, but on edit form it does not show the current value.
It gets set to the default option.
The domain is like this:
Listing <has_one> Address <belongs_to> Neighbourhood
The drop down used to work for address edit form, before nesting the model.
address.rb -> http://gist.github.com/310879
partial _address_form.html.erb -> http://gist.github.com/310880
The method @neighbourhood_for_metro in following snippet is a helper which works perfectly fine.
<p> <%= address_form.label :neighbourhood %><br /> <%= collection_select(:address,:neighbourood,@neighbourhood_for_metro,:id,:name) %> </p> I spent enough time on this issue to know its some silly thing that I am missing. I would really appreciate if any one could help me solve this issue. regards, aakash