Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How to get currentuser into model
2 Posts
How to get currentuser into model

Hi, I want to get current login user into models.But models wont access session Can anybody help

Person
Forum Rating: 50
Sign In To Rate Post

Hi,

Go through following link

http://www.zorched.net/2007/05/29/making-session-data-available-to-models-in-ruby-on-rails/

In that you will get the module UserInfo methodology .. by which u can access your session data in your controller as well as model file also...

try that.. I hope it'll help you.

Either if you will use 'authologic' gem/plugin then no need to worry about access your session at any place.

Good Luck ;)

-Ganesh K

Person
Jruby, Ruby, Rails Programmer
Sign In To Rate Post
2 Posts
Login to add your message