namespaces client_api/users/user_controller.rb

This commit is contained in:
Toni Dezman 2017-08-25 08:21:52 +02:00
parent 4ea4c30e29
commit e4a704d063
3 changed files with 18 additions and 17 deletions

View file

@ -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

View file

@ -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

View file

@ -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