Advertisement
solidsnake

Devise Gem

Feb 26th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. gem 'devise' --> authorization and authentication
  2.  
  3. Authentication
  4. -logged into the system enables you to do functionalities in the system
  5.  
  6. Authenticated
  7. -are you authorized to do A, B or C
  8. -administrator of system or viewer of data
  9.  
  10. User
  11. email (string)
  12. enrcypted_password (string)
  13.  
  14. Authorization
  15.  
  16. rails generate devise:install
  17. -migration file for model called user.rb
  18. -what makes this unique is it makes user with email and encrypted password
  19.  
  20. rails generate model User
  21.  
  22. before_filter :authenticate_user! -- put inside controller
  23.  
  24. Controller_authentication
  25. -before filter
  26.  
  27. View authentication
  28. -user_signed_in?
  29.  
  30. 1. rails g devise User
  31. 2. authenticate controller by adding before filter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement