This gives us more flexibility and allows us to use password authentication later. Also we don't need to build the login functionality ourself.
27 lines
928 B
Ruby
27 lines
928 B
Ruby
Rails.application.routes.draw do
|
|
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
|
|
|
|
resources :forms do
|
|
member { get :form }
|
|
resources :submissions
|
|
end
|
|
# short link for submission file uploads
|
|
get '/s/:form_id/:submission_id/:id' => 'file_uploads#show', as: :file_upload
|
|
|
|
# form post url to save new submissions
|
|
post '/s/:form_id' => 'submissions#create', as: :submission
|
|
# short URL for form page
|
|
get '/s/:id/form' => 'forms#form', as: :form_submitter
|
|
|
|
get 'oauth/callback', to: 'oauths#callback'
|
|
get 'oauth/:provider', to: 'oauths#oauth', as: :auth_at_provider
|
|
|
|
get '/signup' => 'sessions#new', as: :signup # TODO: add proper signup page
|
|
get '/login' => 'sessions#new', as: :login
|
|
get '/logout' => 'sessions#destroy', as: :logout
|
|
get '/auth' => 'sessions#auth', as: :auth
|
|
|
|
get '/demo' => 'home#demo', as: :demo
|
|
root 'home#index'
|
|
end
|