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

routes.rb 4.3KB

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