# How to redirector to another controller within subcontroller

**URL:** <https://www.ruby-forum.com/t/how-to-redirector-to-another-controller-within-subcontroller/89609>\
**Category:** Rails\
**Created:** [March 21, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/how-to-redirector-to-another-controller-within-subcontroller/89609 "2007-03-21T16:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sneptune](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sneptune](https://www.ruby-forum.com/u/sneptune)\
**Post date:** [March 21, 2007, 4:55pm UTC](https://www.ruby-forum.com/t/how-to-redirector-to-another-controller-within-subcontroller/89609/1 "2007-03-21T16:55:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sneptune](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sneptune](https://www.ruby-forum.com/u/sneptune)\
**Post date:** [March 21, 2007, 5:07pm UTC](https://www.ruby-forum.com/t/how-to-redirector-to-another-controller-within-subcontroller/89609/2 "2007-03-21T17:07:50Z")

</div>

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](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![sneptune](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sneptune](https://www.ruby-forum.com/u/sneptune)\
**Post date:** [March 21, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/how-to-redirector-to-another-controller-within-subcontroller/89609/3 "2007-03-21T17:34:47Z")

</div>

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](mailto:removed_email_address@domain.invalid)

Thank you. It works now.
