[Rails] Passing parameters to before_filter methods
Gerret Apelt
gerret.apelt at gmail.com
Thu Dec 15 08:12:29 GMT 2005
Hi Ian, I do this:
def Controller < ActionController::Base
before_filter { |c| c.role_required 'admin' }
def role_required(role)
...
end
end
cheers,
Gerret
On 12/15/05, Ian J Cottee <icottee at bluefountain.com> wrote:
> I have a method that checks for a given role. I want to write
> something in my controllers like
>
> before_filter :check_roles('admin')
>
> Which will ensure the current user has the admin role. Is it possible
> to pass parameters in this way?
>
> Ian
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
More information about the Rails
mailing list