summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-10 10:17:31 +0100
committerAzul <azul@leap.se>2013-01-10 10:17:31 +0100
commitf75005e1bc15101f37d377b7ed06f877dc206ee0 (patch)
tree178fe7723a52f68871afe98a62199c5dbdeb9074 /users
parentcee6db281349789ba5ff6dc8d3dc6ca10400aebe (diff)
moved api routes into their own namespace
In case we need them at some point - now it's new_api_user_path instead of new_user_path for example. This way they should not conflict with the normal route generation
Diffstat (limited to 'users')
-rw-r--r--users/config/routes.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/users/config/routes.rb b/users/config/routes.rb
index 8985502..723d737 100644
--- a/users/config/routes.rb
+++ b/users/config/routes.rb
@@ -1,8 +1,12 @@
Rails.application.routes.draw do
- scope "/1", :module => "V1", defaults: {format: 'json'} do
- resources :sessions, :only => [:new, :create, :update, :destroy]
- resources :users, :only => [:create]
+ constraints :subdomain => "api" do
+ namespace "api", :path => nil do
+ scope "/1", :module => "V1", defaults: {format: 'json'} do
+ resources :sessions, :only => [:new, :create, :update, :destroy]
+ resources :users, :only => [:create]
+ end
+ end
end
get "login" => "sessions#new", :as => "login"