Class: Decidim::PagesController

Inherits:
ApplicationController show all
Defined in:
decidim-core/app/controllers/decidim/pages_controller.rb

Overview

This controller serves static pages using HighVoltage.

Instance Method Summary collapse

Methods inherited from ApplicationController

#store_share_token

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from TranslatableAttributes

#attachment?, #default_locale?

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#indexObject



13
14
15
16
17
# File 'decidim-core/app/controllers/decidim/pages_controller.rb', line 13

def index
  enforce_permission_to :read, :public_page
  @topics = StaticPageTopic.where(organization: current_organization)
  @orphan_pages = StaticPage.where(topic: nil, organization: current_organization)
end

#showObject



19
20
21
22
23
24
# File 'decidim-core/app/controllers/decidim/pages_controller.rb', line 19

def show
  @page = current_organization.static_pages.find_by!(slug: params[:id])
  enforce_permission_to :read, :public_page, page: @page
  @topic = @page.topic
  @pages = @topic&.pages
end