Can I reset / delete the session from a model (rather than from a controller)? When a visitor to my site logs out, all the information they entered into the DB and files created while they were using the site are deleted and then I reset their session. I''m trying to move the cleanup from my controller into my model. Everything works fine in the controller, but I''m getting an " undefined local variable or method ''reset_session'' " error when I call reset_session in the model. Thanks! Bill --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
x1.sean-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-18 14:29 UTC
Re: reset session inside a model?
Its probobly not the best idea to have session handling inside your business logic. Instead, you could implement a "reset" method for models that the user will be using throughout a session and call it from the appropriate action in your controller. #controller file... class MyController def logout @userobject.reset reset_session end end hope that helps. -Sean --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---