Skip to content

Instantly share code, notes, and snippets.

@phoet
Last active June 19, 2023 08:59
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phoet/1386152 to your computer and use it in GitHub Desktop.
Save phoet/1386152 to your computer and use it in GitHub Desktop.
helps finding which partial to look at in rails4
if Rails.env.development?
module My
module PartialRenderer
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
end
ActionView::PartialRenderer.prepend(My::PartialRenderer)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment