module Simplec::PageActionHelpers::InstanceMethods
Private Instance Methods
layout(page)
click to toggle source
Determine the layout for a page.
@param page [Simplec::Page]
@return [String] layout name @!visibility public
# File lib/simplec/page_action_helpers.rb, line 31 def layout(page) # TODO allow config for public [page.layout, page.subdomain.default_layout, 'public']. reject(&:blank?).first end
render_path(path, options={})
click to toggle source
Render the template and layout for a path.
@param path [String] a path without a leading / @param options [Hash] passed through to underlying `render`
@!visibility public
# File lib/simplec/page_action_helpers.rb, line 17 def render_path(path, options={}) @page = page(path) render options.merge( template: 'simplec/pages/show', layout: layout(@page) ) end