Forum: Ruby on Rails ActionController::Filters, any methods to execute the chain?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aaron S. (Guest)
on 2007-06-30 20:05
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
Aaron S. (Guest)
on 2007-06-30 21:01
Aaron S. 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?
>
> Thanks

More 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
This topic is locked and can not be replied to.