Module: Semistatic::Concerns::Controllers::PageViewController
- Extended by:
- ActiveSupport::Concern
- Included in:
- PageViewController
- Defined in:
- lib/semistatic/concerns/controllers/page_view_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
get the page by slug show action render “layouts/templates/#@[email protected]_name”.
Instance Method Details
#show ⇒ Object
get the page by slug show action render “layouts/templates/#Semistatic::Concerns::Controllers::PageViewController.@[email protected]_name”
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/semistatic/concerns/controllers/page_view_controller.rb', line 15 def show page = Page.find_by_slug(params[:slug]) unless page raise ActiveRecord::RecordNotFound.new("Page not found") end @presenter = Presenters::PagePresenter.new(page, self.class.helpers) render file: "semistatic/#{page.template_name}", layout: page.layout end |