Class: Qbrick::Cms::AccountsController

Inherits:
BackendController show all
Defined in:
app/controllers/qbrick/cms/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from BackendController

#default_url_options, #reset_remembered_locale, #set_content_locale

Instance Method Details

#editObject



6
7
8
# File 'app/controllers/qbrick/cms/accounts_controller.rb', line 6

def edit
  @admin = current_admin
end

#update_passwordObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/qbrick/cms/accounts_controller.rb', line 10

def update_password
  @admin = Admin.find(current_admin.id)
  if @admin.update_with_password(admin_params)
    # Sign in the admin by passing validation in case their password changed
     @admin, bypass: true
    redirect_to cms_pages_path
  else
    render 'edit'
  end
end