Files
grecia/app/controllers/pages_controller.rb
Javi Martín a7bbdb1bd0 Simplify rendering a banner
Now the banner component accepts either a banner or a section and loads
the banner if it's a section, so we don't have to add the `@banners`
variable in several controllers.
2021-01-20 17:22:05 +01:00

20 lines
494 B
Ruby

class PagesController < ApplicationController
include FeatureFlags
skip_authorization_check
feature_flag :help_page, if: lambda { params[:id] == "help/index" }
def show
@custom_page = SiteCustomization::Page.published.find_by(slug: params[:id])
if @custom_page.present?
@cards = @custom_page.cards
render action: :custom_page
else
render action: params[:id]
end
rescue ActionView::MissingTemplate
head 404, content_type: "text/html"
end
end