I have a f.select(:attr1, options) in one of my form. But after I submit and if there are any errors in the form it should show the errors and retain all the values in the form. But this attr1 was loosing its value. Instead of the previously selected option, it being reset to the first option. What was wrong?
att_accessible! The attribute wanted to be selected automatically must be in the attr_accessible list. Otherwise Rails won't attach "selected" property to that option.
Notes to self
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment