Class: Api::V1::UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Api::V1::UsersController
- Defined in:
- app/controllers/fbuser/api/v1/users_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /api/1/users/1.
-
#index ⇒ Object
GET /api/1/users.
-
#show ⇒ Object
GET /api/1/users/1.
-
#update ⇒ Object
PATCH/PUT /api/1/users/1.
Instance Method Details
#destroy ⇒ Object
DELETE /api/1/users/1
46 47 48 49 |
# File 'app/controllers/fbuser/api/v1/users_controller.rb', line 46 def destroy @user.destroy render json: {} end |
#index ⇒ Object
GET /api/1/users
14 15 16 17 |
# File 'app/controllers/fbuser/api/v1/users_controller.rb', line 14 def index @users = ::Fbuser::V1::User.all render json: @users end |
#show ⇒ Object
GET /api/1/users/1
20 21 22 |
# File 'app/controllers/fbuser/api/v1/users_controller.rb', line 20 def show render json: @user end |
#update ⇒ Object
PATCH/PUT /api/1/users/1
37 38 39 40 41 42 43 |
# File 'app/controllers/fbuser/api/v1/users_controller.rb', line 37 def update if @user.update(user_params) render json: @user else render :json => {errors: @user.errors.}, status: :unprocessable_entity end end |