Before_filter question


#1

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


#2

On 10 Mar 2006 16:30:58 -0000, Jeff C.
removed_email_address@domain.invalid 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


#3

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


#4

On 10 Mar 2006 17:07:33 -0000, Jeff C.
removed_email_address@domain.invalid 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