Files
nairobi/app/controllers/pages_controller.rb
iagirre 0d9da5398b Fix banners in user pages
Banners were not been shown in certain pages; now
they are.

Spec to check if the banner is been shown correctly
added. Before it was in admins specs, now it has it's
own spec out of admins folder.
2018-07-12 10:17:25 -04:00

17 lines
397 B
Ruby

class PagesController < ApplicationController
skip_authorization_check
def show
@custom_page = SiteCustomization::Page.published.find_by(slug: params[:id])
@banners = Banner.in_section('help_page').with_active
if @custom_page.present?
render action: :custom_page
else
render action: params[:id]
end
rescue ActionView::MissingTemplate
head 404
end
end