Class: MyAccountsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MyAccountsController
- Defined in:
- app/controllers/my_accounts_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/controllers/my_accounts_controller.rb', line 33 def destroy @profile.destroy respond_to do |format| format.html { redirect_to my_account_url, notice: 'devise.registrations.destroyed' } format.json { head :no_content } end end |
#edit ⇒ Object
13 14 15 |
# File 'app/controllers/my_accounts_controller.rb', line 13 def edit end |
#show ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/my_accounts_controller.rb', line 5 def show respond_to do |format| format.html format.html.phone format.json { render json: @profile } end end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/my_accounts_controller.rb', line 17 def update respond_to do |format| @profile.assign_attributes(profile_update_params) if @profile.save bypass_sign_in(current_user) format.html { redirect_to my_account_url, notice: t('controller.successfully_updated', model: t('activerecord.models.user')) } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: current_user.errors, status: :unprocessable_entity } end end end |