Forum: Ruby on Rails before_filter - How to?

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.
vimal (Guest)
on 2009-03-04 14:15
(Received via mailing list)
Hi,

i have functions for which i use before_filter
---------------------------------------------------------------------------
before_filter :find_customer, :except => [:index, :new, :create]
---------------------------------------------------------------------------

Do i need to use another before_filter for another set of functions
like
---------------------------------------------------------------------------
before_filter :countries_list, :only => [:new, :edit]
---------------------------------------------------------------------------

Are there any ways to pin both into a single implementation

Regards,
Vimal Das
Frederick C. (Guest)
on 2009-03-04 14:58
(Received via mailing list)
On 4 Mar 2009, at 12:13, vimal wrote:

> ---------------------------------------------------------------------------
> before_filter :countries_list, :only => [:new, :edit]
> ---------------------------------------------------------------------------
>
If you need two filters, then you need two calls to before_filter.

Fred
This topic is locked and can not be replied to.