Knowing the method from before_filter

I would like to know the method that will be called from
before_filter, is it possible?

for example

class TestController < ApplicationController

before_filter :tell_method_name

protected
def tell_method_name
#tell the name of the method that is going to be called
end

def index

end

end

so if i call http://localhost:3000/test, it will call tell_method_name
and display “index”, how can i do it in here?

On 14 Jan 2008, at 07:41, hsun wrote:

I would like to know the method that will be called from
before_filter, is it possible?

You can use action_name to get the name of the current action.

Fred

Thank you very much

On Jan 14, 3:52 pm, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs