From e4a704d063dbd94339d5562923818cadcca2ba5c Mon Sep 17 00:00:00 2001 From: Toni Dezman Date: Fri, 25 Aug 2017 08:21:52 +0200 Subject: [PATCH] namespaces client_api/users/user_controller.rb --- .../client_api/users/users_controller.rb | 16 ++++++++++++++++ app/controllers/client_api/users_controller.rb | 14 -------------- config/routes.rb | 5 ++--- 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 app/controllers/client_api/users/users_controller.rb delete mode 100644 app/controllers/client_api/users_controller.rb diff --git a/app/controllers/client_api/users/users_controller.rb b/app/controllers/client_api/users/users_controller.rb new file mode 100644 index 000000000..109330adb --- /dev/null +++ b/app/controllers/client_api/users/users_controller.rb @@ -0,0 +1,16 @@ +module ClientApi + module Users + class UsersController < ApplicationController + + def current_user_info + respond_to do |format| + format.json do + render template: '/client_api/users/show', + status: :ok, + locals: { user: current_user } + end + end + end + end + end +end diff --git a/app/controllers/client_api/users_controller.rb b/app/controllers/client_api/users_controller.rb deleted file mode 100644 index 13a8451c5..000000000 --- a/app/controllers/client_api/users_controller.rb +++ /dev/null @@ -1,14 +0,0 @@ -module ClientApi - class UsersController < ApplicationController - - def current_user_info - respond_to do |format| - format.json do - render template: '/client_api/users/show', - status: :ok, - locals: { user: current_user } - end - end - end - end -end diff --git a/config/routes.rb b/config/routes.rb index a557b7a66..0d271915e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,11 +8,10 @@ Rails.application.routes.draw do root 'projects#index' - # Settings root + # Client APP endpoints get '/settings', to: 'client_api/settings#index' get '/settings/*all', to: 'client_api/settings#index' - # Client APP endpoints namespace :client_api, defaults: { format: 'json' } do # activities get '/activities', to: 'activities#index' @@ -22,7 +21,7 @@ Rails.application.routes.draw do # notifications get '/recent_notifications', to: 'notifications#recent_notifications' # users - get '/current_user_info', to: 'users#current_user_info' + get '/current_user_info', to: 'users/users#current_user_info' end # Save sample table state