Forum: Ruby on Rails Passing params between actions?

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.
Eric B. (Guest)
on 2006-05-09 07:49
(Received via mailing list)
I am wondering what are the rules for the availability of params in
controller actions?  If I redirect, are the params still available?  How
about when I render a different action?  It doesn't seem so...  What are
best ways to pass them?

I'm trying to use an ajax scaffold component with 2 actions which load
different data for the component.  I have an ajax scaffold component
"listings" that I want to use on one page for "new listings" and on a
different page for "listings search results".  I'm also trying to make
"search" action save an object called "saved_search" with the search
parameters so the searches can be re-run later.

So where should code specific to the search action go?  I dont' want to
it in component_update as then both actions would use it.  But if I put
in the search action, I'm not sure how to then pass the params on to the

  if @params[:saved_search_id]
      @saved_search = SavedSearch.find(params[:saved_search_id])
      @saved_search =

Thanks to Brian H. and Liquid for great answers on my doc question!

This topic is locked and can not be replied to.