Displaying 1 result from an estimated 1 matches for "company_roles".
2008 Jul 08
2
select helper still the worth thing in rails...
...ected value once the choice is
done in my select helper
I setup my slector in a helper (need to include the first option
''all'', as a prompt is displayed only once....
in my partial
def company_role_selection(selection=nil)
roles= [[''all'', 0]]
roles += company_roles.collect {|h| [ h.name,
company_roles.index(h)]}.compact.uniq
select(''role'', ''id'', roles, {:selected => selection} ,{:onchange
=> "$(''select_role'').submit()"})
end
in my controller, I get the selection
@selection = params[:ro...