Class: Decidim::Votings::Admin::VotingsLandingPageController
- Inherits:
-
ApplicationController
- Object
- Admin::ApplicationController
- ApplicationController
- Decidim::Votings::Admin::VotingsLandingPageController
- Includes:
- Admin::ContentBlocks::LandingPage, Admin::ParticipatorySpaceAdminBreadcrumb
- Defined in:
- app/controllers/decidim/votings/admin/votings_landing_page_controller.rb
Overview
Controller that allows to (de)activate the content blocks from a voting landing page
Instance Method Summary collapse
- #content_block_scope ⇒ Object
- #enforce_permission_to_update_resource ⇒ Object
- #resource_content_block_cell ⇒ Object
- #resource_create_url(manifest_name) ⇒ Object
- #resource_sort_url ⇒ Object
- #scoped_resource ⇒ Object (also: #current_participatory_space)
Instance Method Details
#content_block_scope ⇒ Object
17 18 19 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 17 def content_block_scope :voting_landing_page end |
#enforce_permission_to_update_resource ⇒ Object
25 26 27 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 25 def :manage_landing_page, :voting, voting: scoped_resource end |
#resource_content_block_cell ⇒ Object
38 39 40 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 38 def resource_content_block_cell "decidim/votings/content_block" end |
#resource_create_url(manifest_name) ⇒ Object
33 34 35 36 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 33 def resource_create_url(manifest_name) voting_landing_page_content_blocks_path(participatory_process_group_id: params[:participatory_process_group_id], manifest_name:) end |
#resource_sort_url ⇒ Object
29 30 31 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 29 def resource_sort_url voting_landing_page_path(scoped_resource) end |
#scoped_resource ⇒ Object Also known as: current_participatory_space
21 22 23 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 21 def scoped_resource @scoped_resource ||= Voting.find_by(slug: params[:voting_slug], organization: current_organization) end |