Download app/controllers/api/v1/profile_controller.rb from denise-oneill-inbox-ru/Rails-8-API-Image-Processing: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/denise-oneill-inbox-ru/Rails-8-API-Image-Processing/resolve/main/app/controllers/api/v1/profile_controller.rb
- Command line
-
hf download hf://spaces/denise-oneill-inbox-ru/Rails-8-API-Image-Processing/app/controllers/api/v1/profile_controller.rb
-
curl -L -o profile_controller.rb https://huggingface.co/spaces/denise-oneill-inbox-ru/Rails-8-API-Image-Processing/resolve/main/app/controllers/api/v1/profile_controller.rb
544 Bytes
| module Api | |
| module V1 | |
| class ProfileController < BaseController | |
| def show | |
| render json: UserBlueprint.render(current_user) | |
| end | |
| def update | |
| if current_user.update(profile_params) | |
| render json: UserBlueprint.render(current_user) | |
| else | |
| render json: { errors: current_user.errors.full_messages }, status: :unprocessable_entity | |
| end | |
| end | |
| private | |
| def profile_params | |
| params.require(:user).permit(:full_name, :avatar_public_id) | |
| end | |
| end | |
| end | |
| end | |