Hey folks I''ve got a couple of Actions that call methods in different controllers. So for example I rewrite the URI from /home to /login/login However, when I do this Firefox displays a "You are being redirected" message and IE simply dies. Is there anyway round this or should I just avoid moving controllers like this. Cheers Iain -- 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 -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2007-Jun-18 16:40 UTC
Re: "You are being redirected" when switching controllers
I assume this means you''re doing something other than the norm: redirect_to :controller => "login", :action => "login" or are you talking about render :action => ... ? Jason On 6/18/07, Iain <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hey folks > > I''ve got a couple of Actions that call methods in different controllers. > So for example I rewrite the URI from > > /home > > to > > /login/login > > However, when I do this Firefox displays a "You are being redirected" > message and IE simply dies. > > Is there anyway round this or should I just avoid moving controllers > like this. > > Cheers > Iain > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Niels Meersschaert
2007-Jun-18 21:48 UTC
Re: "You are being redirected" when switching controllers
How are you doing the rewrite? I do this same practice all the time. It''s pretty simple. In the action for home you check if they need to login if they do, then use this snippet: redirect_to :controller => "login", :action => "login" This causes a 302 status code with the correct target url. Niels On Jun 18, 2007, at 11:48 AM, Iain wrote:> > Hey folks > > I''ve got a couple of Actions that call methods in different > controllers. > So for example I rewrite the URI from > > /home > > to > > /login/login > > However, when I do this Firefox displays a "You are being redirected" > message and IE simply dies. > > Is there anyway round this or should I just avoid moving controllers > like this. > > Cheers > Iain > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Hi folks. Thanks for the replies. To explain the full problem. I run my site on a shared host, I know it''s not ideal, but it is cheap. To achieve this I have to run Mongrel using a different port from 80 as my hosting company has Apache running on port 80. So the URI looks like this: www.mysite.com:3500/home I''ve set up a redirect in the .htaccess file so if a user types in www.mysite.com they are forwarded to www.mysite.com:3500/home And from what you are saying I''m wondering if the redirect is part of the problem as I''ve set it up as a Permanent 302 redirect. The problem comes when the user clicks the login button on the home page, the login form code is as follows. <% form_tag :controller => ''login'', :action => ''login'' do %> The browser then writes the URI as www.mysite.com:3500/login/login and that''s when I get the redirect error. Annoyingly this doesn''t happen when I''m working from localhost Any ideas greatfully received :-) -- 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 -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2007-Jun-19 12:41 UTC
Re: "You are being redirected" when switching controllers
I''d say do one of two things: Get rid of the .htaccess redirect. You''re bypassing, and thus confusing, Rails. Move the Rails site to have it''s root at www.mysite.com:3500/home. This seems like it would fit your situation better. Jason On 6/19/07, Iain <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi folks. > > Thanks for the replies. To explain the full problem. I run my site on > a shared host, I know it''s not ideal, but it is cheap. To achieve this > I have to run Mongrel using a different port from 80 as my hosting > company has Apache running on port 80. So the URI looks like this: > > www.mysite.com:3500/home > > I''ve set up a redirect in the .htaccess file so if a user types in > www.mysite.com they are forwarded to www.mysite.com:3500/home > > And from what you are saying I''m wondering if the redirect is part of > the problem as I''ve set it up as a Permanent 302 redirect. > > The problem comes when the user clicks the login button on the home > page, the login form code is as follows. > > <% form_tag :controller => ''login'', :action => ''login'' do %> > > The browser then writes the URI as www.mysite.com:3500/login/login and > that''s when I get the redirect error. > > Annoyingly this doesn''t happen when I''m working from localhost > > Any ideas greatfully received :-) > > > -- > 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 -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-27 22:17 UTC
Re: "You are being redirected" when switching controllers
I''m having the same problem all of a sudden. I''m using the following form: redirect_to :action => "list" Whenever it hits code like this I get a you are being re-directed page, which doesn''t actually re-direct either. On Jun 19, 6:41 am, "Jason Roelofs" <jameskil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''d say do one of two things: > > Get rid of the .htaccess redirect. You''re bypassing, and thus confusing, > Rails. > > Move the Rails site to have it''s root atwww.mysite.com:3500/home. This > seems like it would fit your situation better. > > Jason > > On 6/19/07, Iain <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > Hi folks. > > > Thanks for the replies. To explain the full problem. I run my site on > > a shared host, I know it''s not ideal, but it is cheap. To achieve this > > I have to run Mongrel using a different port from 80 as my hosting > > company has Apache running on port 80. So the URI looks like this: > > >www.mysite.com:3500/home > > > I''ve set up a redirect in the .htaccess file so if a user types in > >www.mysite.comthey are forwarded towww.mysite.com:3500/home > > > And from what you are saying I''m wondering if the redirect is part of > > the problem as I''ve set it up as a Permanent 302 redirect. > > > The problem comes when the user clicks the login button on the home > > page, the login form code is as follows. > > > <% form_tag :controller => ''login'', :action => ''login'' do %> > > > The browser then writes the URI aswww.mysite.com:3500/login/loginand > > that''s when I get the redirect error. > > > Annoyingly this doesn''t happen when I''m working from localhost > > > Any ideas greatfully received :-) > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
Nominerdene Purevjav
2010-Jun-15 05:57 UTC
Re: "You are being redirected" when switching controllers
I solved this problem by downgrading my rails version to 2.3.5. To downgrade run command gem install -v=2.3.5 rails I Hope soon it will be fixed in 2.3.8 version. Iain wrote:> Hey folks > > I''ve got a couple of Actions that call methods in different controllers. > So for example I rewrite the URI from > > /home > > to > > /login/login > > However, when I do this Firefox displays a "You are being redirected" > message and IE simply dies. > > Is there anyway round this or should I just avoid moving controllers > like this. > > Cheers > Iain-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Iwan Buetti
2010-Jun-15 12:40 UTC
Re: "You are being redirected" when switching controllers
Nominerdene Purevjav wrote:> I solved this problem by downgrading my rails version to 2.3.5. > > To downgrade run command gem install -v=2.3.5 rails > > I Hope soon it will be fixed in 2.3.8 version. > > Iain wrote: >> Hey folks >> >> I''ve got a couple of Actions that call methods in different controllers. >> So for example I rewrite the URI from >>Same problem (but with v. 2.3.8) and same solution (downgrade to 2.3.5). (With glesys.se VPS, Ubuntu 8.04, monit+mongrel) Thanks a lot! Iwan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lenart Rudel
2010-Aug-22 21:21 UTC
Re: "You are being redirected" when switching controllers
Iwan Buetti wrote:> Same problem (but with v. 2.3.8) and same solution (downgrade to 2.3.5). > > (With glesys.se VPS, Ubuntu 8.04, monit+mongrel) > > Thanks a lot! > > IwanGot same problem on Rails 2.3.8, running FreeBSD 7.0, Mongrel 1.1.5 (using clusters). Downgrading to Rails 2.3.5 solved this problem. I believe it''s a combination with mongrel since the same code works flawlessly on passenger. I also got errors (ActionController::InvalidAuthenticityToken). I tried clearing cache, restarting server, ... but nothing seemed to work. Downgrading to 2.3.5 solved this issue as well. Lenart -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.