Class: Kms::UsersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Kms::UsersController
- Defined in:
- app/controllers/kms/users_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/kms/users_controller.rb', line 11 def create user_params.merge!(password: params[:password], password_confirmation: params[:password_confirmation]) if params[:password] @user = User.new(user_params) @user.save render json: @user.to_json end |
#destroy ⇒ Object
18 19 20 21 22 |
# File 'app/controllers/kms/users_controller.rb', line 18 def destroy @user = User.find(params[:id]) @user.destroy render json: @user.to_json end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/kms/users_controller.rb', line 7 def index render json: User.all.to_json(except: [:created_at, :updated_at], methods: :localized_role) end |
#kms_user ⇒ Object
24 25 26 |
# File 'app/controllers/kms/users_controller.rb', line 24 def kms_user render json: current_kms_user.to_json end |