Module: RenderDebug::PreRenderCallout

Extended by:
ActiveSupport::Concern
Defined in:
lib/render_debug/pre_render_callout.rb

Instance Method Summary collapse

Instance Method Details

#render_with_callout(context, options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/render_debug/pre_render_callout.rb', line 8

def render_with_callout(context, options)
  initial_render = render_without_callout(context, options)
  tag = ""
  if(options[:partial])
    tag = "PARTIAL #{options[:partial]}"
  elsif(options[:template])
    tag = "ACTION #{options[:template]} INVOKED FROM #{context.controller.class.to_s}"
  end

  if(tag.blank?)
    initial_render.html_safe
  else
    "<!-- #{tag} -->#{initial_render}<!-- END #{tag}-->".html_safe
  end
end