Module: Simplec::PageActionHelpers::InstanceMethods
- Defined in:
- lib/simplec/page_action_helpers.rb
Instance Method Summary collapse
-
#layout(page) ⇒ String
Determine the layout for a page.
-
#render_path(path, options = {}) ⇒ Object
Render the template and layout for a path.
Instance Method Details
#layout(page) ⇒ String
Determine the layout for a page.
31 32 33 34 35 |
# 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 = {}) ⇒ Object
Render the template and layout for a path.
17 18 19 20 21 22 23 |
# File 'lib/simplec/page_action_helpers.rb', line 17 def render_path(path, ={}) @page = page(path) render .merge( template: 'simplec/pages/show', layout: layout(@page) ) end |