Retrospring/config/routes.rb

37 lines
1.7 KiB
Ruby
Raw Normal View History

2014-08-01 02:23:47 -07:00
Rails.application.routes.draw do
2014-08-01 02:47:25 -07:00
root 'static#index'
2014-08-01 02:23:47 -07:00
2014-08-01 02:47:25 -07:00
match '/about', to: 'static#about', via: 'get'
2014-11-02 08:58:27 -08:00
# Devise routes
devise_for :users, path: 'user', skip: [:sessions, :registrations]
as :user do
# :sessions
get 'sign_in' => 'devise/sessions#new', as: :new_user_session
post 'sign_in' => 'devise/sessions#create', as: :user_session
delete 'sign_out' => 'devise/sessions#destroy', as: :destroy_user_session
# :registrations
get 'settings/delete_account' => 'devise/registrations#cancel', as: :cancel_user_registration
post '/user/create' => 'devise/registrations#create', as: :user_registration
get '/sign_up' => 'devise/registrations#new', as: :new_user_registration
get '/settings/account' => 'devise/registrations#edit', as: :edit_user_registration
2014-11-03 04:21:41 -08:00
patch '/settings/account' => 'devise/registrations#update', as: :update_user_registration
2014-11-02 08:58:27 -08:00
put '/settings/account' => 'devise/registrations#update'
delete '/settings/account' => 'devise/registrations#destroy'
end
match '/settings/profile', to: 'user#edit', via: 'get', as: :edit_user_profile
2014-11-03 04:21:41 -08:00
match '/settings/profile', to: 'user#update', via: 'patch', as: :update_user_profile
namespace :ajax do
match '/ask', to: 'question#create', via: :post, as: :ask
2014-11-11 07:19:20 -08:00
match '/answer', to: 'inbox#destroy', via: :post, as: :answer
end
2014-11-03 04:21:41 -08:00
2014-11-10 22:10:41 -08:00
match '/inbox', to: 'inbox#show', via: 'get'
2014-11-12 11:40:24 -08:00
match '/user/:username(/p/:page)', to: 'user#show', via: 'get', defaults: {page: 1}
match '/@:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile, defaults: {page: 1}
match '/:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile_alt, defaults: {page: 1}
2014-08-01 02:23:47 -07:00
end