Class: PushType::Api::UsersController
- Inherits:
-
PushType::ApiController
- Object
- ActionController::Base
- PushType::ApiController
- PushType::Api::UsersController
- Defined in:
- app/controllers/push_type/api/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/controllers/push_type/api/users_controller.rb', line 16 def create if @user.save render :show, status: :created else render json: { errors: @user.errors }, status: :unprocessable_entity end end |
#destroy ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'app/controllers/push_type/api/users_controller.rb', line 32 def destroy if @user != push_type_user @user.destroy head :no_content else head :bad_request end end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/push_type/api/users_controller.rb', line 9 def index @users = user_scope.page(params[:page]).per(30) end |
#show ⇒ Object
13 14 |
# File 'app/controllers/push_type/api/users_controller.rb', line 13 def show end |
#update ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/controllers/push_type/api/users_controller.rb', line 24 def update if @user.update_attributes user_params_with_fields render :show else render json: { errors: @user.errors }, status: :unprocessable_entity end end |