Class: Decidim::Votings::Admin::VotingsLandingPageController
- Inherits:
-
ApplicationController
- Object
- Admin::ApplicationController
- ApplicationController
- Decidim::Votings::Admin::VotingsLandingPageController
- Includes:
- Admin::ContentBlocks::LandingPage
- 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
14 15 16 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 14 def content_block_scope :voting_landing_page end |
#enforce_permission_to_update_resource ⇒ Object
22 23 24 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 22 def :manage_landing_page, :voting, voting: scoped_resource end |
#resource_content_block_cell ⇒ Object
35 36 37 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 35 def resource_content_block_cell "decidim/votings/content_block" end |
#resource_create_url(manifest_name) ⇒ Object
30 31 32 33 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 30 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
26 27 28 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 26 def resource_sort_url voting_landing_page_path(scoped_resource) end |
#scoped_resource ⇒ Object Also known as: current_participatory_space
18 19 20 |
# File 'app/controllers/decidim/votings/admin/votings_landing_page_controller.rb', line 18 def scoped_resource @scoped_resource ||= Voting.find_by(slug: params[:voting_slug], organization: current_organization) end |