Class: Decidim::Admin::ManagedUsers::PromotionsController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::Admin::ManagedUsers::PromotionsController
- Defined in:
- decidim-admin/app/controllers/decidim/admin/managed_users/promotions_controller.rb
Overview
Controller that allows promoting managed users at the admin panel.
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_ability_klass, #user_not_authorized_path
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'decidim-admin/app/controllers/decidim/admin/managed_users/promotions_controller.rb', line 18 def create :promote, user @form = form(ManagedUserPromotionForm).from_params(params) PromoteManagedUser.call(@form, user, current_user) do on(:ok) do flash[:notice] = I18n.t("managed_users.promotion.success", scope: "decidim.admin") redirect_to managed_users_path end on(:invalid) do flash.now[:alert] = I18n.t("managed_users.promotion.error", scope: "decidim.admin") render :new end end end |
#new ⇒ Object
13 14 15 16 |
# File 'decidim-admin/app/controllers/decidim/admin/managed_users/promotions_controller.rb', line 13 def new :promote, user @form = form(ManagedUserPromotionForm).instance end |