Hi All this is driving me batty. I am trying to do a search, the form I have created has radio buttons and a text field
_full_search.rhtml <p>Staff Number<%= radio_button_tag(:search,:staff,0) %> NI Number<%= radio_button_tag(:search, :staff, 1) %> File Number<%= radio_button_tag(:search, :staff, 2) %> name<%= radio_button_tag(:search, :staff, 3) %></p> <p><%= text_field(:search_text, "", "size"=>10)%></p>
The controller should then check which button is checked and search as appropriate, there is placeholder text for this as the moment as no matter which button I check, I always get the same output! help! controller def staff_search @search_text = params[:search] @word = params[:search_text] if @search_text = "staff0" @word = 1 if @search_text = "staff1" @word = 2 if @search_text = "staff2" @word = 3 else @word = 2 end end end end