Class: Panda::Core::Admin::MyProfileController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Panda::Core::Admin::MyProfileController
- Defined in:
- app/controllers/panda/core/admin/my_profile_controller.rb
Instance Method Summary collapse
-
#edit ⇒ Object
Shows the edit form for the current user’s profile.
-
#update ⇒ Object
Updates the current user’s profile.
Methods inherited from BaseController
#add_breadcrumb, #authenticate_admin_user!, #authenticate_user!, #breadcrumbs, #current_user, #set_current_request_details, #user_signed_in?
Instance Method Details
#edit ⇒ Object
Shows the edit form for the current user’s profile
12 13 14 |
# File 'app/controllers/panda/core/admin/my_profile_controller.rb', line 12 def edit render :edit, locals: {user: current_user} end |
#update ⇒ Object
Updates the current user’s profile
19 20 21 22 23 24 25 26 |
# File 'app/controllers/panda/core/admin/my_profile_controller.rb', line 19 def update if current_user.update(user_params) flash[:success] = "Your profile has been updated successfully." redirect_to edit_admin_my_profile_path else render :edit, locals: {user: current_user}, status: :unprocessable_content end end |