I have a form like so:
<% form_remote_tag(:url => { :action => :foo}, :complete =>
“do_some_cool_ajax(request);”) do %>
<%= text_field_tag :myInput, params[:myInput], :size => 80 %>
<%= submit_tag "do function 1", :name => "f1"%>
<%= submit_tag "do funciton 2", :name => "f2"%>
I would hope to get parameters that have only one of the names so that
I can test like so
if params[“f1”]
do some f1 stuff
else if params[“f2”]
do some f2 stuff
else…
For this to work I need something like this in params:
Example 1: Parameters: {“f1”=>"", “action”=>“foo”,
“controller”=>“bar”, “myInput”=>“foobar”}
However I’m getting
Example 2: Parameters: {“f1”=>"", “f2”=>"", “f3”=>"", “f4”=>"",
“f5”=>"", “f6”=>"", “action”=>“foo”, “controller”=>“bar”,
“myInput”=>“foobar”}
Any ideas on how to isolate each of these actions so that I know which
submit was actually sent? Google searching lists a buch of sites that
say Example 1 should work.
I’ve tested on osx both firefox and safari and I get the same results.