From f75005e1bc15101f37d377b7ed06f877dc206ee0 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 10 Jan 2013 10:17:31 +0100 Subject: 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 --- users/config/routes.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'users') 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" -- cgit v1.2.3