A website template with lots of features, built with ruby on rails.

routes.rb 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. RailsWebsiteTemplate::Application.routes.draw do
  2. resources :contact_messages, path: '/contact'
  3. resources :uploads
  4. get "admin/dashboard" => "admin_panel#dashboard", :as => :admin_dashboard
  5. get "admin" => "admin_panel#index"
  6. get "admin/posts" => "admin_panel#posts", :as => :admin_posts
  7. get "admin/contact_messages" => "admin_panel#contact_messages", :as => :admin_contact_messages
  8. get "admin/users" => "admin_panel#users", :as => :admin_users
  9. get "admin/config" => "admin_panel#site_config", :as => :admin_config
  10. post "admin/config/update" => "admin_panel#site_config_update", :as => :config_update
  11. post "upload" => "uploads#upload", :as => :post_upload
  12. get "blog" => "blog_posts#index", :as => :blog
  13. get "post/:id" => "blog_posts#show", :as => :post
  14. resources :blog_posts, path: '/admin/posts'
  15. get '/admin/files' => "admin_panel#files", :as => :admin_files
  16. resources :uploads, path: '/admin/files'
  17. get "start/index"
  18. devise_for :users, :skip => [:sessions, :passwords, :confirmations, :registrations]
  19. as :user do
  20. get 'login' => 'devise/sessions#new', :as => :new_user_session
  21. post 'login' => 'devise/sessions#create', :as => :user_session
  22. delete 'logout' => 'devise/sessions#destroy', :as => :destroy_user_session
  23. get 'signup' => 'devise/registrations#new', :as => :new_user_registration
  24. post 'signup' => 'devise/registrations#create', :as => :user_registration
  25. put 'signup' => 'users/registrations#update', :as => :user_registration_update
  26. scope '/account' do
  27. # password reset
  28. get '/reset-password' => 'devise/passwords#new', as: 'new_user_password'
  29. put '/reset-password' => 'devise/passwords#update', as: 'user_password'
  30. post '/reset-password' => 'devise/passwords#create'
  31. get '/reset-password/change' => 'devise/passwords#edit', as: 'edit_user_password'
  32. # confirmation
  33. get '/confirm' => 'devise/confirmations#show', as: 'user_confirmation'
  34. post '/confirm' => 'devise/confirmations#create'
  35. get '/confirm/resend' => 'devise/confirmations#new', as: 'new_user_confirmation'
  36. # settings & cancellation
  37. get '/cancel' => 'devise/registrations#cancel', as: 'cancel_user_registration'
  38. get '/settings' => 'devise/registrations#edit', as: 'edit_user_registration'
  39. put '/settings' => 'users/registrations#update', as: 'update_user_registration'
  40. # account deletion
  41. delete '' => 'devise/registrations#destroy'
  42. end
  43. end
  44. # The priority is based upon order of creation: first created -> highest priority.
  45. # See how all your routes lay out with "rake routes".
  46. # You can have the root of your site routed with "root"
  47. # root 'welcome#index'
  48. # Example of regular route:
  49. # get 'products/:id' => 'catalog#view'
  50. # Example of named route that can be invoked with purchase_url(id: product.id)
  51. # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
  52. # Example resource route (maps HTTP verbs to controller actions automatically):
  53. # resources :products
  54. # Example resource route with options:
  55. # resources :products do
  56. # member do
  57. # get 'short'
  58. # post 'toggle'
  59. # end
  60. #
  61. # collection do
  62. # get 'sold'
  63. # end
  64. # end
  65. # Example resource route with sub-resources:
  66. # resources :products do
  67. # resources :comments, :sales
  68. # resource :seller
  69. # end
  70. # Example resource route with more complex sub-resources:
  71. # resources :products do
  72. # resources :comments
  73. # resources :sales do
  74. # get 'recent', on: :collection
  75. # end
  76. # end
  77. # Example resource route with concerns:
  78. # concern :toggleable do
  79. # post 'toggle'
  80. # end
  81. # resources :posts, concerns: :toggleable
  82. # resources :photos, concerns: :toggleable
  83. # Example resource route within a namespace:
  84. # namespace :admin do
  85. # # Directs /admin/products/* to Admin::ProductsController
  86. # # (app/controllers/admin/products_controller.rb)
  87. # resources :products
  88. # end
  89. root 'start#index'
  90. end