Files
nairobi/app/controllers/pages_controller.rb
2019-01-18 09:54:43 -05:00

21 lines
525 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])
@banners = Banner.in_section('help_page').with_active
if @custom_page.present?
@cards = @custom_page.cards
render action: :custom_page
else
render action: params[:id]
end
rescue ActionView::MissingTemplate
head 404
end
end