Module: PartiallyUseful::PartialRenderer

Defined in:
lib/partially_useful/partial_renderer.rb

Instance Method Summary collapse

Instance Method Details

#render_partial(context, options, &block) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/partially_useful/partial_renderer.rb', line 3

def render_partial(context, options, &block)
  if html_context?(context)
    msg = "rendering '#{options[:partial]}' with locals '#{(options[:locals] || {}).keys}'"
    "<!-- start #{msg}-->\n#{super(context, options, &block)}\n<!-- end #{msg}-->\n".html_safe
  else
    super(context, options, &block)
  end
end