If I do something like this:
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter RubyCAS::Filter
before_filter :fetch_operator
include SessionsHelper
private
def fetch_operator
@current_operator ||= session[:cas_user] &&
Operator.find_by_uid(session[:cas_user])
rescue ActiveRecord::RecordNotFound
redirect_to("/404.html")
end
end
The fetch_operator action is always executed, before every action in
every controller?
I'd want to fetch the operator only at start and not before every
action but I need to have it available on every view and controller.
--
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.