Typo error, it should be:

def call_operator_once
    if !session[:operator_called]
      fetch_operator()
      session[:operator_called] = true
    end
end

Right, it will called before each action of each controller in your
application, but only one time the fetch_operator method will be
executed. I thought you want to make sure that fetch_operator method
is executed at least one time independent of controller. Now, if you
want to use a filter method and avoid to call it in other controllers
you can use "skip_before_filter :my_method" in each controller. And if
you definitely don't use this method in other controllers, I guess you
don't need define a filter method, just call it as usually in each
action that you need it, because any filter that you defined inside
the ActionController class will be inherited by other controllers.

On Feb 24, 4:44 pm, Mauro <[email protected]> wrote:
>
> Yes but it executes the call_operator before each action of each controller 
> in my application.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to