Forum: Ruby on Rails How to redirector to another controller within subcontroller

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.
Wai T. (Guest)
on 2007-03-21 17:55
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?
wesgarrison (Guest)
on 2007-03-21 18:07
(Received via mailing list)
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>
Wai T. (Guest)
on 2007-03-21 18:34
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.
This topic is locked and can not be replied to.