Class: SupplejackApi::UsersController
Instance Method Summary
collapse
#authenticate_admin!, #authenticate_user!, #current_user, #find_user_set
Instance Method Details
#create ⇒ Object
19
20
21
22
|
# File 'app/controllers/supplejack_api/users_controller.rb', line 19
def create
@user = User.create(user_params)
respond_with @user, location: user_url(@user), serializer: UserSerializer
end
|
#destroy ⇒ Object
30
31
32
33
34
|
# File 'app/controllers/supplejack_api/users_controller.rb', line 30
def destroy
@user = User.custom_find(params[:id])
@user.destroy
respond_with @user
end
|
#show ⇒ Object
14
15
16
17
|
# File 'app/controllers/supplejack_api/users_controller.rb', line 14
def show
@user = User.custom_find(params[:id])
respond_with @user, serializer: UserSerializer
end
|
#update ⇒ Object
24
25
26
27
28
|
# File 'app/controllers/supplejack_api/users_controller.rb', line 24
def update
@user = User.custom_find(params[:id])
@user.update_attributes(user_params)
render json: @user, serializer: UserSerializer
end
|