Luca S. wrote:
I have a HTML-form, that when submitted calles
the action called ‘abc’. But abc needs to redirect_to
a different action, passing to it the ‘params’ variable.
Any suggestions how to use redirect_to passing it
the params variable ?
I’m not sure which of 2 problems you’re having, but both have short
To pass parameters with redirect_to you simply add them. Like …
redirect_to :controller => ‘another’, :action => ‘def’, :param1 =>
:param2 => ‘thing’, :param => ‘else’
I’m guessing you’re asking about the fact that parameters only ‘live’
one request-response cycle. redirect_to ends one cycle and starts
so, in the situation you’ve outlined, you’ll need to save them to (a)
variable(s) in the first method, then add them to the redirect_to to
them in the second. Of course, you could also store them in the session
in the database too.