I have a simple form where I set the default value of a select list as follows
f.select :post, (1..5).to_a, {:value => @author.posts }
if validation fails on the create action this list is always reset to 1.
In the create method after testing validation if I set
@author.posts = 5
then it will set the list to 5. However it does not set the list based on what was submitted.
Have tried to set
@author.posts = params[:post]
however it defaults to 1, using debugger have verified that params[:post] has the value selected (eg 5).
Is there some pointer stuff going on I'm missing? Any suggestions?