Class: MyAccountsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/my_accounts_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



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 , notice: 'devise.registrations.destroyed' }
    format.json { head :no_content }
  end
end

#editObject



13
14
15
# File 'app/controllers/my_accounts_controller.rb', line 13

def edit
  prepare_options
end

#showObject



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

#updateObject



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
      (current_user)
      format.html { redirect_to , notice: t('controller.successfully_updated', model: t('activerecord.models.user')) }
      format.json { head :no_content }
    else
      prepare_options
      format.html { render action: 'edit' }
      format.json { render json: current_user.errors, status: :unprocessable_entity }
    end
  end
end