Forum: Ruby on Rails Filtering object list with select_tags + pagination + Ajax f

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
3a810d2631e26e61c51c26041c386036?d=identicon&s=25 Sam Pierson (Guest)
on 2007-06-13 21:32
(Received via mailing list)
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?


This topic is locked and can not be replied to.