Hi, I''ve a small problem here : class ApplicationController < ActionController::Base def maintenance redirect_to :controller => ''static'', :action => ''maintenance'' end end class CompteController < ApplicationController before_filter :maintenance end I can see on WebRick logs that there is a loop and /static/maintenance is called forever. Why ?? before_filter :maintenance is only used with the CompteController Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
I did a try : when maintenance() method is placed in CompteController instead of ApplicationController it works... I don''t understand why a derived class can''t set a before_filter using an parent class method... Any idea ? -- 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 -~----------~----~----~----~------~----~------~--~---
It smells like Yor''re calling over and over the maintenance action defined in ApplicationController. Probably the ''maintenance'' action which is replying in static controller is the one defined in ApplicationController and not the one you expect. breakpoint''ll be your friend. Paolo On 24/11/06, nuno <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, I''ve a small problem here : > > class ApplicationController < ActionController::Base > def maintenance > redirect_to :controller => ''static'', :action => ''maintenance'' > end > end > > class CompteController < ApplicationController > before_filter :maintenance > end > > I can see on WebRick logs that there is a loop and /static/maintenance > is called forever. Why ?? > > before_filter :maintenance is only used with the CompteController > > Thanks > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Paolo Negri wrote:> It smells like Yor''re calling over and over the maintenance action > defined in ApplicationController. > Probably the ''maintenance'' action which is replying in static > controller is the one defined in ApplicationController and not the one > you expect. > breakpoint''ll be your friend. > > Paolo100% right Paolo !! Thanks a lot ! I''ve changed action name used in the redirect_to and it works. A rail''s bug ?? -- 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 -~----------~----~----~----~------~----~------~--~---
Well ApplicationController does have an action called maintenance, so rails might not be completely wacky. Out of interest if you mark the maintenance method in ApplicationController as protected, does that also solve the problem ? Fred -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> Well ApplicationController does have an action called maintenance, so > rails might not be completely wacky. Out of interest if you mark the > maintenance method in ApplicationController as protected, does that also > solve the problem ? > > FredI did not tried with protecting but I''ve changed the method''s name in the ApplicationController and put back the action name of :action to "maintenance" and it works also... So, as you said there something between that maintenance method defined in rails and mine.. Thanks ! -- 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 -~----------~----~----~----~------~----~------~--~---