Sha256: 207ad889f8364a4caacd1b9fe8482fea4dd769b38abc50fd7bbd8ec2d46e4a8d
Contents?: true
Size: 949 Bytes
Versions: 8
Compression:
Stored size: 949 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
8 entries across 8 versions & 2 rubygems