Guest User

Untitled

a guest
May 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. # potential solution?
  2.  
  3. def action1
  4. u = User.new
  5. # do something...
  6. u.save
  7. cookies["user_id"] = u.id
  8. session["new_user"] = u.id
  9. end
  10.  
  11. def action2
  12. u = User.find_by_id( cookies["user_id"] )
  13. if u.nil?
  14. user_id = session["new_user"]
  15. # new user...
  16. # options?
  17. end
  18. # do something...
  19. end
Add Comment
Please, Sign In to add comment