I am using two filters without any problems like so:
before_filter :auth_login
before_filter :get_group, :only => [:edit, :delete, :show]
the :auth_login is always performed. I also checked this with an
:except option on my :get_group before_filter and the auth_login still
worked.
So, I suspect the problem lies somewhere else. Your filters should be
able to specify different conditions.
Feel free to post more info if you need more help.
Good Luck,
Tom
On 5/8/06, Lindsay Boyd <lindsay.boyd@ntlworld.com>
wrote:> Hi,
>
> Is it possible to specify multiple before filters in a controller...
> here''s the thing: only one set of filters is to use the :except
option.
> Something like:
>
> before_filter :check_for_session_cookie
> before_filter :validate_user :except =>[''login'']
>
> which I use to a) check if the user has returned to the site and has a
> saved cookie holding login details b) check to see if user is logged on,
> unless they are attempting to do so.
>
> As far as I can tell the :except is applied to both my before filters.
> Am I right in thinking this is because both my filters are chained, and
> the :except is applied to the chain?
>
> thanks
> Lindsay
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Tom Davies
http://blog.atomgiant.com
http://gifthat.com