I''ve added two before filters in one of my controllers like so: before_filter :filter_one before_filter :filter_two The first filter (:filter_one) always fires, but the second filter (:filter_two) never does. Anyone know how to make both filters always fire? Thanks. -Dan -- 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.
On Thu, Jan 19, 2012 at 10:23 AM, Dan King <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I''ve added two before filters in one of my controllers like so: > > before_filter :filter_one > before_filter :filter_two > > The first filter (:filter_one) always fires, but the second filter > (:filter_two) never does. Anyone know how to make both filters always > fire?That works fine for me, though I would probably just put both on the same line, e.g. before_filter :filter_one, :filter_two Chances are your second filter is failing somehow; adding logging statements might help track it down. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
what version of rails are you using? on 3.1.3 all three of these fire fine for me in my application controller... before_filter :must_login before_filter :must_be_member before_filter :must_be_admin jordan On Jan 19, 2012, at 1:23 PM, Dan King wrote:> I''ve added two before filters in one of my controllers like so: > > before_filter :filter_one > before_filter :filter_two > > The first filter (:filter_one) always fires, but the second filter > (:filter_two) never does. Anyone know how to make both filters always > fire? > > Thanks. > > -Dan > > -- > 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. >-- 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.
Could it be that your first filter is preventing the request from reaching your second filter? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/T2tkRsusNssJ. 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.