In my view, I have: <%= select("division_filter", "division_id", Division.find_all.collect {|p| [ p.division, p.id ] }, { :include_blank => true }) %> How do I retrieve the division_id in my controller? -- Posted via http://www.ruby-forum.com/.
FYI, here is the HTML generated by the above: <select id="division_filter_division_id" name="division_filter[division_id]"> <option value=""></option> <option value="1">Division1Name</option> <option value="2">Division2Name</option> <option value="3">Division3Name</option> <option value="4">Division4Name</option> </select> -- Posted via http://www.ruby-forum.com/.
On 1/18/06, Eric Mills <mills.eric@gmail.com> wrote:> FYI, here is the HTML generated by the above: > > <select id="division_filter_division_id" > name="division_filter[division_id]"> > <option value=""></option> > <option value="1">Division1Name</option> > <option value="2">Division2Name</option> > <option value="3">Division3Name</option> > <option value="4">Division4Name</option> > </select>In your controller, params[:division_filter][:division_id] will contain the selected value.