With ruby 1.8.5 / Rails 1.2.3
I am trying to develop a page that:
o Displays a list of objects.
o Allows you to filter the list of objects using criteria selected
from pulldown menus,
o Paginates the objects with Prev and Next Page buttons.
and here's the fun part...
o Refreshes the list every time a filter pulldown changes or a page
button is clicked
I've gotten this working without Ajax. My filters are select_tags and
I have three submit_tags in the form: one called Refresh, one Prev
Page and one Next Page. This provides my controller with all the
filter settings in params and I can tell if a pagination button was
clicked by looking at params[:commit], and I adjust the page number
appropriately (I'm using the builtin paginator, but not the links it
Now to start adding Ajax.
Problem 1: If I change form_tag to form_remote_tag, the
params[:commit] trick no longer works - it is always set to
"Refresh". It is probably bad HTML to have multiple submits in the
same form and am probably using completely the wrong strategy to
implement this. Any thoughts?