Sha256: e8bfb165c136cfa8d4f4aca34e87322af8ad2f3fa0062f24abce833b94c2cc0a
Contents?: true
Size: 872 Bytes
Versions: 37
Compression:
Stored size: 872 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals module Admin class ProposalsSplitsController < Admin::ApplicationController def create enforce_permission_to :split, :proposals @form = form(Admin::ProposalsSplitForm).from_params(params) Admin::SplitProposals.call(@form) do on(:ok) do |_proposal| flash[:notice] = I18n.t("proposals_splits.create.success", scope: "decidim.proposals.admin") redirect_to EngineRouter.admin_proxy(@form.target_component).root_path end on(:invalid) do flash.now[:alert] = I18n.t("proposals_splits.create.invalid", scope: "decidim.proposals.admin") redirect_to EngineRouter.admin_proxy(current_component).root_path end end end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems