How to redirector to another controller within subcontroller


#1

Hi,

I have been developing a web application using Rails and Firefox. I
have factored the controllers into different subcontrollers.

For example,
user/profile (User::ProfilerController)
user/permission (User::PermissionController)

app (AppController)

etc…

However, in this case, there is no way for controllers under user to
redirect to app. If I use redirect_to :controller => :app, it will try
to redirect to user/app instead of just app.

Routing Error

no route found to match “/user/app” with {:method=>:get}

If I use redirect_to :controller => “…/app”, it would work in Firefox
but not in Internet Explorer. It seems hackish as well. Does anyone
have any suggestion what I can do?


#2

redirect_to :controller => “/app”

… will redirect to “app” at the base of your site.

redirect_to :controller => “app”

… will redirect to “app” in the same controller that you’re in
currently.

– Wes

On Mar 21, 10:55 am, Wai T. removed_email_address@domain.invalid


#3

wesgarrison wrote:

redirect_to :controller => “/app”

… will redirect to “app” at the base of your site.

redirect_to :controller => “app”

… will redirect to “app” in the same controller that you’re in
currently.

– Wes

On Mar 21, 10:55 am, Wai T. removed_email_address@domain.invalid

Thank you. It works now.