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.
Tom T. (Guest)
on 2006-02-20 13: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!

Kent S. (Guest)
on 2006-02-20 16: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.