Class: Hello::Management::ProfilesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Hello::Management::ProfilesController
- Defined in:
- app/controllers/hello/management/profiles_controller.rb
Instance Method Summary collapse
-
#cancel ⇒ Object
GET /hello/user/cancel.
-
#destroy ⇒ Object
DELETE /hello/user.
-
#show ⇒ Object
GET /hello/user.
-
#update ⇒ Object
PATCH /hello/user.
Instance Method Details
#cancel ⇒ Object
GET /hello/user/cancel
41 42 43 |
# File 'app/controllers/hello/management/profiles_controller.rb', line 41 def cancel render 'hello/management/cancel' end |
#destroy ⇒ Object
DELETE /hello/user
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'app/controllers/hello/management/profiles_controller.rb', line 46 def destroy @cancel_account = Business::Management::CancelAccount.new(current_user) if @cancel_account.cancel_account flash[:notice] = @cancel_account. respond_to do |format| format.html { redirect_to '/' } format.json { render json: { cancelled: true }, status: :ok } end else flash.now[:alert] = @cancel_account. respond_to do |format| format.html { render 'hello/management/cancel' } format.json { render json: { message: @cancel_account. }, status: :unprocessable_entity } end end end |
#show ⇒ Object
GET /hello/user
13 14 15 16 17 18 |
# File 'app/controllers/hello/management/profiles_controller.rb', line 13 def show respond_to do |format| format.html { render 'hello/management/user' } format.json { render json: @user.as_json_web_api, status: :ok } end end |
#update ⇒ Object
PATCH /hello/user
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/hello/management/profiles_controller.rb', line 21 def update if @user_business.update(user_params) use_locale(current_user.locale) flash[:notice] = @user_business. respond_to do |format| format.html { redirect_to hello.profile_path } format.json { render json: @user.as_json_web_api, status: :ok } end else render 'hello/management/user' end end |