Last active
June 19, 2023 08:59
-
-
Save phoet/1386152 to your computer and use it in GitHub Desktop.
helps finding which partial to look at in rails4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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