How to make the f.select rails selected -
it's code:
<%= f.select :area, options_for_select([['a','a'],['b','b'],['c','c']]), {}, {:class => 'span3 controls controls-row'}, :selected => params[:area] %>
and result is:
argumenterror in users#edit showing /home/airson/rails_projects/friends_of_local/app/views/users/edit.html.erb line #17 raised: wrong number of arguments (5 4)
why.....@@?
no need use :selected
pass params[:area]
alone options_for_select second argument:
<%= f.select :area, options_for_select([['a','a'],['b','b'],['c','c']], params[:area]), {}, { :class => 'span3 controls controls-row' } %>
the last value of params[:area]
selected.
hope helps ; )
Comments
Post a Comment