Wai Tsang
2007-Mar-21 15:55 UTC
How to redirector to another controller within subcontroller
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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
wesgarrison
2007-Mar-21 16:03 UTC
Re: How to redirector to another controller within subcontroller
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 Tsang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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? > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Wai Tsang
2007-Mar-21 16:34 UTC
Re: How to redirector to another controller within subcontro
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 Tsang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thank you. It works now. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---