Forum: Ruby on Rails Calling controllers in a controller

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.
Sushruth B. (Guest)
on 2005-11-14 09:59
Hi

I'm a noob, so, please bare with me. I tried to find it online but could
not. Can i call a controller from inside a controller?

class UsersController < ApplicationController
def index
 do soem thing
 redirect_to :action => new_controller
end

Thanks
Daniel -. (Guest)
on 2005-11-14 10:08
(Received via mailing list)
Hi Sushruth,

What I think your looking for is to redirect to another controller.

redirect_to :controller => 'controller_name', :action =>'action'

Hope this helps....

Cheers
Sushruth B. (Guest)
on 2005-11-14 10:17
liquid wrote:
> Hi Sushruth,
>
> What I think your looking for is to redirect to another controller.
>
> redirect_to :controller => 'controller_name', :action =>'action'
>
> Hope this helps....
>
> Cheers

Thanks very much, I wors now :)
This topic is locked and can not be replied to.