Forum: Ruby on Rails simple question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thila T. (Guest)
on 2006-01-17 08:43
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.
Jakob S. (Guest)
on 2006-01-17 09:17
(Received via mailing list)
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
Thila T. (Guest)
on 2006-01-17 10:03
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.
Ron F. (Guest)
on 2008-03-28 04:18
(Received via mailing list)
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
This topic is locked and can not be replied to.