I’m having a hard time finding an answer to my question. I would
like to have multiple form actions based on what the user selects.
For example, I trying to do something similar to Amazon Zuggest,
using Ian McDonald’s Ruby/Amazon.
I have three types of searches which translates to 3 actions in the
SearchController. I have a drop down menu like so,
This works. The problem is, I want to use either form_remote_tag or
something like this:
<%= submit_to_remote(“search”, “Search”,
:url => {:controller => “search”, :action =>
“search_artists”},
:html => {:class => ‘search’},
:update => :item,
:method => ‘get’) %>)
Both of which work perfectly, as the results which I display with a
three different partial templates, are returned without page refresh.
However, in doing so, I am forced to hard code the :action of
submit_to_remote, thereby, disabling the line of javascript in the
select menu.
Does anyone have any ideas on how to implement this ? Sorry that this
is my second time asking this question on this list. I know you’re
all busy, and I know Ruby, but am fairly new to Rails. I’d rather
not use three forms for what should be fairly simple.
Thanks in advance,
Regards, Markus A.