Simple question


#1

How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as parameters to
the redirect_to

Thanks.


#2

On Jan 17, 2006, at 7:43, thila thila wrote:

How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as
parameters to
the redirect_to

redirect_to :controller => ‘other’, :action => ‘stuff’, :model_id =>
43, :foo => ‘bar’

will make params[:model_id] and params[:foo] available in the other
controller/action.


Jakob S. - http://mentalized.net


#3

More precisely, ruby variables are references to objects, not the object
itself. You can return a reference to any type of object, including an
Array.

RF


#4

Jakob S. wrote:

On Jan 17, 2006, at 7:43, thila thila wrote:

How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as
parameters to
the redirect_to

redirect_to :controller => ‘other’, :action => ‘stuff’, :model_id =>
43, :foo => ‘bar’

will make params[:model_id] and params[:foo] available in the other
controller/action.


Jakob S. - http://mentalized.net

Thanks Jakob for the prompt help.