Class: Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessGroupLandingPageController

Inherits:
ApplicationController
  • Object
show all
Includes:
Admin::ContentBlocks::LandingPage, TranslatableAttributes
Defined in:
app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb

Overview

Controller that allows managing the participatory process group landing page

Instance Method Summary collapse

Instance Method Details

#content_block_scopeObject



19
20
21
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 19

def content_block_scope
  :participatory_process_group_homepage
end

#enforce_permission_to_update_resourceObject



27
28
29
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 27

def enforce_permission_to_update_resource
  enforce_permission_to :update, :process_group, process_group: scoped_resource
end

#resource_content_block_cellObject



40
41
42
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 40

def resource_content_block_cell
  "decidim/participatory_process_groups/content_block"
end

#resource_create_url(manifest_name) ⇒ Object



35
36
37
38
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 35

def resource_create_url(manifest_name)
  participatory_process_group_landing_page_content_blocks_path(participatory_process_group_id: params[:participatory_process_group_id],
                                                               manifest_name:)
end

#resource_sort_urlObject



31
32
33
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 31

def resource_sort_url
  participatory_process_group_landing_page_path(scoped_resource)
end

#scoped_resourceObject Also known as: participatory_process_group



23
24
25
# File 'app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb', line 23

def scoped_resource
  @scoped_resource ||= collection.find(params[:participatory_process_group_id])
end