Class: Decidim::Admin::ManagedUsersController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::Admin::ManagedUsersController
- Defined in:
- decidim-admin/app/controllers/decidim/admin/managed_users_controller.rb
Overview
Controller that allows managing 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
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'decidim-admin/app/controllers/decidim/admin/managed_users_controller.rb', line 31 def create :create, :managed_users @form = form(ManagedUserForm).from_params(params) CreateManagedUser.call(@form) do on(:ok) do flash[:notice] = I18n.t("managed_users.create.success", scope: "decidim.admin") redirect_to managed_users_path end on(:invalid) do flash.now[:alert] = I18n.t("managed_users.create.error", scope: "decidim.admin") render :new end end end |
#index ⇒ Object
14 15 16 17 |
# File 'decidim-admin/app/controllers/decidim/admin/managed_users_controller.rb', line 14 def index :index, :managed_users @managed_users = collection.page(params[:page]).per(15) end |
#new ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'decidim-admin/app/controllers/decidim/admin/managed_users_controller.rb', line 19 def new :new, :managed_users if handler_name.present? @form = form(ManagedUserForm).from_params( authorization: { handler_name: handler_name } ) end end |