Forum: Ruby on Rails before_filter question

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.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Jeff Cohen (Guest)
on 2006-03-10 17:33
(Received via mailing list)
Let's say I'm using before_filter in my controller:

  before_filter :setup

  def setup
    # do something here
  end

Is there any way my setup method can know which action is really about
to be called?  Let's say I want to log out which action is going to be
called, how can I  know that in the before_filter method? (My question
is not really about logging, that's just an example).

Thanks!
Jeff
119af50160cabfe1fb6f2f05f5018c64?d=identicon&s=25 James Ludlow (Guest)
on 2006-03-10 17:45
(Received via mailing list)
On 10 Mar 2006 16:30:58 -0000, Jeff Cohen
<devlists-rubyonrails@devlists.com> wrote:
> called, how can I  know that in the before_filter method? (My question
> is not really about logging, that's just an example).

logger.debug("ACTION=" + action_name)


You can find the docs for this here: http://api.rubyonrails.org/

Click on "ActionController::Base".  Scroll down to Attributes.



-- James
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Jeff Cohen (Guest)
on 2006-03-10 18:10
(Received via mailing list)
>You can find the docs for this here: http://api.rubyonrails.org/
>
>Click on "ActionController::Base".  Scroll down to Attributes.
>

Thanks James.  Sorry I missed that.

Jeff
119af50160cabfe1fb6f2f05f5018c64?d=identicon&s=25 James Ludlow (Guest)
on 2006-03-10 20:06
(Received via mailing list)
On 10 Mar 2006 17:07:33 -0000, Jeff Cohen
<devlists-rubyonrails@devlists.com> wrote:
> >You can find the docs for this here: http://api.rubyonrails.org/
> >
> >Click on "ActionController::Base".  Scroll down to Attributes.
> >
>
> Thanks James.  Sorry I missed that.

No need to apologize.  I was just pointing out the docs, because
there's a lot of other useful attributes in there too.

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