Hello,
I''ve got a controller, which I''d like to protect from being
accessed by
untrusted users. I saw that you can use before_filter to do it.
I tried before_filter :filter on the page I''d like to protect and then
creating a private method on the super class and it works. I''d now like
to get some information from the controller ... So I tried before_filter
ApplicationController on the controller and then :
def self.filter(controller)
id = self.session[:user_id]
# some other stuff
end
And now, I get an error at the line of session :
TypeError in AdministrationController#index
Symbol as array index
Could you explain me why ?
Thanks a lot
--
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
-~----------~----~----~----~------~----~------~--~---