Forum: Ruby on Rails Using :except or :only on a before_filter block

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
143d37bc67b04ad4fdc69beddda48651?d=identicon&s=25 Tom Taylor (Guest)
on 2006-02-20 12:03
(Received via mailing list)
Hi all,

How do you use :except or :only conditions on a filter block? I can't
seem to work out the syntax!

I'm currently doing:

before_filter { |c| c.role_required 'admin' }

Thanks a lot!

3ccecc71b9fb0a3d7f00a0bef6f0a63a?d=identicon&s=25 Kent Sibilev (Guest)
on 2006-02-20 15:17
(Received via mailing list)
before_filter(:only => [:anaction]) { |c| c.role_required 'admin' }
before_filter(:except => [:anaction]) { |c| c.role_required 'admin' }

This topic is locked and can not be replied to.