Class: Kms::UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kms/users_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_csrf_cookie_for_ng

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
# File 'app/controllers/kms/users_controller.rb', line 12

def create
  @user = User.new(user_params)
  if @user.save
    head :no_content
  else
    render json: {errors: @user.errors}.to_json, status: :unprocessable_entity
  end
end

#destroyObject



21
22
23
24
25
# File 'app/controllers/kms/users_controller.rb', line 21

def destroy
  @user = User.find(params[:id])
  @user.destroy
  head :no_content
end

#indexObject



8
9
10
# File 'app/controllers/kms/users_controller.rb', line 8

def index
  render json: User.all
end

#kms_userObject



27
28
29
# File 'app/controllers/kms/users_controller.rb', line 27

def kms_user
  render json: current_kms_user
end