Class: Spree::Admin::ProfileController
- Inherits:
-
BaseController
- Object
- BaseController
- BaseController
- Spree::Admin::ProfileController
- Includes:
- SettingsConcern
- Defined in:
- app/controllers/spree/admin/profile_controller.rb
Constant Summary
Constants included from LocaleConcern
LocaleConcern::ADMIN_LOCALE_COOKIE
Instance Method Summary collapse
Methods included from SettingsConcern
Methods included from BreadcrumbConcern
#add_breadcrumb_icon_instance_var
Instance Method Details
#edit ⇒ Object
6 7 8 |
# File 'app/controllers/spree/admin/profile_controller.rb', line 6 def edit @user = try_spree_current_user end |
#update ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/spree/admin/profile_controller.rb', line 10 def update @user = try_spree_current_user if @user.update(user_params) if params[:remove_avatar] == '1' && @user.avatar.attached? @user.avatar.detach @user.avatar.purge_later end flash[:success] = (@user, :successfully_updated) redirect_to spree.edit_admin_profile_path else render :edit, status: :unprocessable_content end end |