how to retrieve user name from cookie session data(RAILS) -
how to retrieve user name from cookie session data(RAILS) - i studying ror, have partial side bar gets rendered in user dashboard area, , returning user's name in dashboard so. dashboard layout included in user controller. need utilize new controller <h1>welcome back, <%= @user.name %> </h1> so changed to <h1>welcome back, <%= current_user %> </h1> but problem instead of returning username, current_user returns this #<user:0x007fa8ee293940> which assuming remember_token hash. since current_user have session cookie, not sure how traverse db the username. can help me tweak current_user current session user returns username? thanks! here session helper def sign_in(user) remember_token = user.new_remember_token cookies.permanent[:remember_token] = remember_token user.update_attribute(:remember_token, user.digest(remember_token)) self.current_user = user end d...