Class: Decidim::Conferences::Admin::RegistrationTypesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- Admin::ApplicationController
- ApplicationController
- Decidim::Conferences::Admin::RegistrationTypesController
- Includes:
- ApplicationHelper, Concerns::ConferenceAdmin, Paginable
- Defined in:
- decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb
Overview
Controller that allows managing conference speakers.
Constant Summary
Constants included from Paginable
Constants included from AmendmentsHelper
Instance Method Summary collapse
Methods included from ApplicationHelper
#cell, #edit_link, #extra_admin_link, #html_truncate, #present, #prevent_timeout_seconds, #resolve_presenter_class, #step_cta_url
Methods included from Decidim::CacheHelper
Methods included from AmendmentsHelper
#accept_and_reject_buttons_for, #action_button_card_for, #allowed_to_accept_and_reject?, #allowed_to_promote?, #amend_button_for, #amendments_enabled?, #amendments_form_field_for, #amendments_form_fields_label, #amendments_form_fields_value, #can_participate_in_private_space?, #can_react_to_emendation?, #current_step, #emendation_actions_for, #emendation_announcement_for, #promote_button_for, #render_emendation_body, #total_steps, #wizard_aside_back_url, #wizard_header_title
Methods included from RichTextEditorHelper
Methods included from Decidim::ContextualHelpHelper
Methods included from ScopesHelper
#has_visible_scopes?, #scope_name_for_picker, #scopes_picker_field, #scopes_picker_filter, #scopes_select_field, #scopes_select_tag
Methods included from TranslatableAttributes
Methods included from DecidimFormHelper
#areas_for_select, #base_error_messages, #decidim_form_for, #decidim_form_slug_url, #editor_field_tag, #form_field_has_error?, #form_required_explanation, #name_with_locale, #ordered_scopes_descendants, #ordered_scopes_descendants_for_select, #scopes_picker_field_tag, #tab_element_class_for, #translated_field_tag
Methods included from OmniauthHelper
#normalize_provider_name, #oauth_icon, #provider_name
Methods inherited from Admin::ApplicationController
#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path
Methods included from Headers::HttpCachingDisabler
Methods included from NeedsSnippets
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 24 def create :create, :registration_type @form = form(Decidim::Conferences::Admin::RegistrationTypeForm).from_params(params) CreateRegistrationType.call(@form, current_user, current_conference) do on(:ok) do flash[:notice] = I18n.t("registration_types.create.success", scope: "decidim.admin") redirect_to conference_registration_types_path(current_conference) end on(:invalid) do flash.now[:alert] = I18n.t("registration_types.create.error", scope: "decidim.admin") render :new end end end |
#destroy ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 65 def destroy @registration_type = collection.find(params[:id]) :destroy, :registration_type, registration_type: @registration_type DestroyRegistrationType.call(@registration_type, current_user) do on(:ok) do flash[:notice] = I18n.t("registration_types.destroy.success", scope: "decidim.admin") redirect_to conference_registration_types_path(current_conference) end end end |
#edit ⇒ Object
41 42 43 44 45 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 41 def edit @registration_type = collection.find(params[:id]) :update, :registration_type, registration_type: @registration_type @form = form(Decidim::Conferences::Admin::RegistrationTypeForm).from_model(@registration_type) end |
#index ⇒ Object
13 14 15 16 17 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 13 def index :index, :registration_type @registration_types = paginate(collection) end |
#new ⇒ Object
19 20 21 22 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 19 def new :create, :registration_type @form = form(Decidim::Conferences::Admin::RegistrationTypeForm).instance end |
#update ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'decidim-conferences/app/controllers/decidim/conferences/admin/registration_types_controller.rb', line 47 def update @registration_type = collection.find(params[:id]) :update, :registration_type, registration_type: @registration_type @form = form(Decidim::Conferences::Admin::RegistrationTypeForm).from_params(params) UpdateRegistrationType.call(@form, @registration_type) do on(:ok) do flash[:notice] = I18n.t("registration_types.update.success", scope: "decidim.admin") redirect_to conference_registration_types_path(current_conference) end on(:invalid) do flash.now[:alert] = I18n.t("registration_types.update.error", scope: "decidim.admin") render :edit end end end |