Forum: Ruby on Rails @params not available in 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.
41165a7e7126d616a0ae0762e00718e2?d=identicon&s=25 bigsmoke (Guest)
on 2005-11-25 10:38
(Received via mailing list)
I'm trying to use @params in a before filter, but it appears to be
nil. From the description in the API docs I understand that I should
have access to the complete request from all the filters in my
controller. What could I be doing wrong?

 - Rowan
41165a7e7126d616a0ae0762e00718e2?d=identicon&s=25 bigsmoke (Guest)
on 2005-11-29 13:15
(Received via mailing list)
On 11/25/05, BigSmoke <bigsmoke@gmail.com> wrote:
> I'm trying to use @params in a before filter, but it appears to be
> nil. From the description in the API docs I understand that I should
> have access to the complete request from all the filters in my
> controller. What could I be doing wrong?

I found out what I was doing wrong.  I was using the inline method as in

  before_filter { false if @params['uncool'] }

instead of

  before_filter { |controller| false if controller.params['uncool'] }

Quite stupid. I know.

 - Rowan
This topic is locked and can not be replied to.