method
before_filter
before_filter(*filters, &block)
public
Alias for #append_before_filter
Register or
log in
to add new notes.
Vidmantas -
July 31, 2008
edavey -
July 23, 2008 - (v1.2.0 - v2.1.0)
7 thanks
Multiple filter methods with :only, :except
Notice that this methods accepts *filters param, so you can pass array of methods with :only or :except too
Example
before_filter [:authorize, :set_locale], :except => :login
6 thanks
:only, :except and passing in multiple parameters
To specify that the filter should be applied to or excluded from given controller actions, use the :only and :except parameters. To pass in multiple controller actions use an array:
before_filter :authorize, :except => [:index, :show] before_filter :authorize, :only => :delete

