Class: Hyrax::Dashboard::ProfilesController
- Inherits:
-
UsersController
- Object
- ApplicationController
- UsersController
- Hyrax::Dashboard::ProfilesController
- Defined in:
- app/controllers/hyrax/dashboard/profiles_controller.rb
Overview
Shows and edit the profile of the current_user
Instance Method Summary collapse
-
#edit ⇒ Object
Display form for users to edit their profile information.
- #show ⇒ Object
-
#update ⇒ Object
Process changes from profile form.
Methods inherited from UsersController
Instance Method Details
#edit ⇒ Object
Display form for users to edit their profile information
19 20 21 22 23 24 25 |
# File 'app/controllers/hyrax/dashboard/profiles_controller.rb', line 19 def edit t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.admin.sidebar.profile'), hyrax.dashboard_profile_path @trophies = Hyrax::TrophyPresenter.find_by_user(@user) end |
#show ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/controllers/hyrax/dashboard/profiles_controller.rb', line 10 def show t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.admin.sidebar.profile'), hyrax.dashboard_profile_path @presenter = Hyrax::UserProfilePresenter.new(@user, current_ability) end |
#update ⇒ Object
Process changes from profile form
28 29 30 31 32 33 34 35 |
# File 'app/controllers/hyrax/dashboard/profiles_controller.rb', line 28 def update if conditionally_update handle_successful_update redirect_to hyrax.dashboard_profile_path(@user.to_param), notice: "Your profile has been updated" else redirect_to hyrax.edit_dashboard_profile_path(@user.to_param), alert: @user.errors. end end |