Class: PufferPages::Renderer
- Inherits:
-
ActionView::TemplateRenderer
- Object
- ActionView::TemplateRenderer
- PufferPages::Renderer
- Defined in:
- lib/puffer_pages/renderer.rb
Instance Method Summary collapse
- #determine_template(options) ⇒ Object
- #find_layout(layout, keys) ⇒ Object
- #render(context, options) ⇒ Object
Instance Method Details
#determine_template(options) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/puffer_pages/renderer.rb', line 8 def determine_template() @view.assign(@view.assigns.merge!('puffer_page' => [:puffer_page])) super rescue ActionView::MissingTemplate [:text] = '' super end |
#find_layout(layout, keys) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/puffer_pages/renderer.rb', line 17 def find_layout(layout, keys) layout = "<%= render(:inline => @puffer_page.render(puffer_pages_context), :layout => @puffer_page.layout_for_render) %>" handler = ActionView::Template.handler_for_extension("erb") ActionView::Template.new(layout, "puffer pages layout wrapper", handler, :locals => keys) end |
#render(context, options) ⇒ Object
3 4 5 6 |
# File 'lib/puffer_pages/renderer.rb', line 3 def render(context, ) @view = context super end |