Passing params between actions?

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs