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

routes.rb 5.0KB

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