Class: Decidim::PagesController
Overview
This controller serves static pages using HighVoltage.
Instance Method Summary
collapse
#disable_http_caching
enhance_controller, extended, included
Instance Method Details
#index ⇒ Object
13
14
15
16
|
# File 'app/controllers/decidim/pages_controller.rb', line 13
def index
enforce_permission_to :read, :public_page
@pages = current_organization.static_pages.sorted_by_i18n_title
end
|
#page ⇒ Object
29
30
31
|
# File 'app/controllers/decidim/pages_controller.rb', line 29
def page
@page ||= current_organization.static_pages.find_by(slug: params[:id])
end
|
#show ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/decidim/pages_controller.rb', line 18
def show
enforce_permission_to :read, :public_page, page: page
if params[:id] == "home"
render :home
elsif page
render :decidim_page
else
raise ActionController::RoutingError, "Not Found"
end
end
|