Class: Stay::Api::V1::ProfilesController
- Inherits:
-
BaseApiController
- Object
- BaseApiController
- Stay::Api::V1::ProfilesController
- Defined in:
- app/controllers/stay/api/v1/profiles_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
4 5 6 |
# File 'app/controllers/stay/api/v1/profiles_controller.rb', line 4 def show render json: { profile: @profile } end |
#update ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/controllers/stay/api/v1/profiles_controller.rb', line 8 def update if @profile.update(profile_params) data = ActiveModelSerializers::SerializableResource.new(@profile, serializer: UserSerializer) render json: { profile: data, success: true }, status: :ok else render json: { errors: @profile.errors., success:false }, status: :unprocessable_entity end end |