Guest User

Untitled

a guest
Mar 10th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #AUTHLOGIC BASIC SETUP - NOT FINISHED YET
  2.  
  3. inside("vendor") do
  4. run "cp -r ~/rails_templates/base/plugins/authlogic plugins/"
  5. end
  6.  
  7. generate :controller, "Users", "index", "show", "new", "create", "edit", "update", "destroy"
  8. generate :model, "User", "username:string", "email:string", "crypted_password:string", "persistence_token:string", "password_salt:string"
  9.  
  10. rake "db:migrate"
  11.  
  12. generate :controller, "UsersSession", "new", "destroy"
  13. generate :model, "UserSession", "username:string", "password:string"
  14.  
  15. inside('public') do
  16. run 'rm index.html'
  17. run 'cp ~/rails_templates/base/stylesheets/default.css stylesheets/'
  18. run 'cp ~/rails_templates/base/stylesheets/reset.css stylesheets/'
  19. end
  20.  
  21. inside('app/views') do
  22. run 'cp ~/rails_templates/base/application.html.erb layouts/'
  23. end
  24.  
  25. run 'rm config/routes.rb'
  26.  
  27. file 'config/routes.rb', <<-CODE
  28. ActionController::Routing::Routes.draw do |map|
  29.  
  30. map.root :controller => "users_session", :action => "new"
  31.  
  32. #Named routes
  33. map.login 'login', :controller => 'users_session', :action => 'new'
  34. map.logout 'logout', :controller => 'users_session', :action => 'destroy'
  35.  
  36. #Default routes
  37. map.connect ':controller/:action/:id'
  38. map.connect ':controller/:action/:id.:format'
  39.  
  40. end
  41. CODE
  42.  
  43. run 'script/server'
Add Comment
Please, Sign In to add comment