I would like to know how to set default value on form_for select.
My code goes like this:
<%= form_for(@user) do |f| %> . . .
Add a parameter :selected =>
<%= form_for(@user) do |f| %> . . . <%= f.select(:user_group_id, options_for_select(@user_groups.collect {|p| [ p.name, p.id ] }, "Select Category"), :selected =>f.object.user_group_id) %> <%= end %>