I''ve moved an application onto the production server, and found that
when I run it under the production environment active_rbac doesn''t work
(it''s fine under the development environment). I find this in the logs
when trying to view a protected page:
NoMethodError (undefined method `before_filter'' for
ActiveRbac::ComponentController:Class):
/app/controllers/active_rbac/component_controller.rb:2
...lots more stuff...
The offending code is:
class ActiveRbac::ComponentController
before_filter :protect_with_active_rbac
protected
def protect_with_active_rbac
# only protect certain controllers
return true if [ActiveRbac::LoginController,
ActiveRbac::RegistrationController,
ActiveRbac::MyAccountController].include?(self.class)
# protect!
if !session[:rbac_user_id].nil? and
User.find_by_id(session[:rbac_user_id]).has_role?("Admin")
return true
else
flash[:notice] = "Please log in to
access this page."
redirect_to "/login"
return false
end
end
end
Can anyone suggest where I might begin to look for the cause of this
error?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---