Last active
August 29, 2015 14:18
-
-
Save bensie/49c9bc83599c40e06dfb to your computer and use it in GitHub Desktop.
Rails Authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.routes.draw do | |
scope module: "api" do | |
constraints subdomain: "api" do | |
match "/", to: "root#options", via: [:options] | |
match "*unmatched", to: "root#options", via: [:options] | |
resource :me, only: [:show, :update], controller: "me" | |
post "/me/access_tokens", to: "access_tokens#create" | |
delete "/me/access_tokens", to: "access_tokens#destroy" | |
shallow do | |
resources :projects, only: [:index, :show, :create, :update, :destroy] do | |
resources :tasks, only: [:index, :show, :create, :update, :destroy] | |
end | |
end | |
get "/", to: "root#index", as: :api_root | |
match "*unmatched", to: "root#not_found", via: [:get] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment