Forum: Ruby on Rails How can I use before_filter?

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.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2008-12-01 01:48
This is my code:

before_filter :authorize, :except=>:login

This is one exception, "login" but I want to add more exceptions. How
can I do this?
Ef0db53920b243d6758c2f6b1306df0d?d=identicon&s=25 Steve Ross (cwd)
on 2008-12-01 01:55
(Received via mailing list)
On Nov 30, 2008, at 4:48 PM, Zhao Yi wrote:

>
> This is my code:
>
> before_filter :authorize, :except=>:login
>
> This is one exception, "login" but I want to add more exceptions. How
> can I do this?
> --

before_filter :authorize, :except=>[:login, :reset_password]
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2008-12-01 02:00
Steve Ross wrote:
> On Nov 30, 2008, at 4:48 PM, Zhao Yi wrote:
>
>>
>> This is my code:
>>
>> before_filter :authorize, :except=>:login
>>
>> This is one exception, "login" but I want to add more exceptions. How
>> can I do this?
>> --
>
> before_filter :authorize, :except=>[:login, :reset_password]

it works, thanks very much.
This topic is locked and can not be replied to.