Skip to content

Instantly share code, notes, and snippets.

@arthurnn
Created May 8, 2014 12:50
Show Gist options
  • Save arthurnn/735eb1fa3aaaaaa0646e to your computer and use it in GitHub Desktop.
Save arthurnn/735eb1fa3aaaaaa0646e to your computer and use it in GitHub Desktop.
module DebugPartialRenderer
def render(context, options, block)
msg = "rendering '#{options[:partial]}' with locals '#{(options[:locals] || {}).keys}'"
"<!-- start #{msg}-->\n#{super(context, options, block)}\n<!-- end #{msg}-->\n".html_safe
end
end
if Rails.env.development?
ActionView::PartialRenderer.prepend(DebugPartialRenderer)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment