Sha256: 4629f52ad3a9f758d3f9d01574152ab5229e6e775820d125961893842e5464fd
Contents?: true
Size: 948 Bytes
Versions: 17
Compression:
Stored size: 948 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin module Concerns # This concern is meant to be included in all controllers that are scoped # into a participatory process' admin panel. It will override the layout # so it shows the sidebar, preload the participatory process, etc. module ParticipatoryProcessAdmin extend ActiveSupport::Concern included do helper_method :participatory_process before_action :ensure_participatory_process layout "decidim/admin/participatory_process" end private def participatory_process @participatory_process ||= current_organization.participatory_processes.find(params[:participatory_process_id]) end def ensure_participatory_process raise ActionController::RoutingError, "Not Found" unless participatory_process end end end end end
Version data entries
17 entries across 17 versions & 2 rubygems