Referencing another controller in a controller?

I realize this is like a super stupid question, but I’m new and would
really appreciate an answer to this question.

I’m setting up an authentication system, and once people sign up, it
redirects them to a welcome action like this: (users_controller.rb)

redirect_to :action => “welcome”

I’d prefer it if they were redirected to a list of recipes (I’m making a
little recipe site). What would I replace “welcome” with to get that to
work? Recipes.list or something like that? I’ve tried a few things, to
no avail.

Thanks!

redirect_to :controller => ‘recipes’, :action => ‘list’

c.

Dave A. wrote:

I realize this is like a super stupid question, but I’m new and would
really appreciate an answer to this question.

I’m setting up an authentication system, and once people sign up, it
redirects them to a welcome action like this: (users_controller.rb)

redirect_to :action => “welcome”

I’d prefer it if they were redirected to a list of recipes (I’m making a
little recipe site). What would I replace “welcome” with to get that to
work? Recipes.list or something like that? I’ve tried a few things, to
no avail.

Thanks!

This should do it:

redirect_to :controller => ‘recipies’, :action => ‘list’

Remember that redirect_to can take anything that the url_for method can
(check that documentation).

Mark

On 11/4/06, Dave A. [email protected] wrote:

I’d prefer it if they were redirected to a list of recipes (I’m making a


Mark Van H.
[email protected]
http://lotswholetime.com