Joshua.Schairbaum-zR6vtFrbgMYAvxtiuMwx3w@public.gmane.org
2005-Oct-24 21:10 UTC
User_id object to string
I''m extremely new to Ruby/Rails and I''m attempting to use Richard Livesay''s Created_by/Updated_by extension with the LoginGenerator. I''m very close but continue to get the same error. Couldn''t find User with ID=#<User:0x5700bb8> The error is in the application.rb controller. It has the following line: User.current_user = User.find(c.session[:user]) unless c.session[:user].nil?>From what I can determine, I think that I''m giving the controller anobject, when it is looking for a string representation of the User id. I''ve tried this: User.current_user = User.find(c.session[:user].id) unless c.session[:user].nil? And I get an error saying that there is an empty string. So, I thought that perhaps I wasn''t storing the id in the session, but I''m able to display the id on the session using: <p>Welcome <%= @session[:user].id %> Does anyone have any clue what I''m doing wrong? I guess I need to change that User reference into a string somehow, but I don''t know how. Thanks for any help. Regards, Joshua Schairbaum