Aaron Smith
2007-Jun-30 16:05 UTC
ActionController::Filters, any methods to execute the chain?
Does anyone know if there is a method to execute a target method on a controller, through the filter logic. Say I want to execute the "list" method, but first have it go through the all the filter logic. Is there a method on ActionController::Filters to do this? 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 -~----------~----~----~----~------~----~------~--~---
Aaron Smith
2007-Jun-30 17:01 UTC
Re: ActionController::Filters, any methods to execute the ch
Aaron Smith wrote:> Does anyone know if there is a method to execute a target method on a > controller, through the filter logic. > > Say I want to execute the "list" method, but first have it go through > the all the filter logic. Is there a method on ActionController::Filters > to do this? > > ThanksMore info:: I''m developing a rails plugin and I need to hijack the filter chain. I load a Controller dynamically and need to be able to execute the filter chain. Ex: load(''my_controller'') @clazz = Object.const_get(''MyController'') @clazz.filter_chain.each do |filter| res = filter.call(@clazz, ?) if !res return else @clazz.myAction() end end So I''m wondering if looping through the filter_chain is the best way to do this? Is there a method to handle this for me? I don''t really see one in the source, but maybe somebody knows how.. Any ideas? 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 -~----------~----~----~----~------~----~------~--~---