if development? | |
module ActionView | |
class Base | |
alias_method :rails_render, :render | |
# add debugging comments for partials to the rendered html | |
def render(options = {}, local_assigns = {}, &block) | |
output = rails_render(options, local_assigns, &block) | |
if options.respond_to?(:keys) && options[:partial] && (response.content_type.nil? || response.content_type =~ /html/) | |
debug_output = "rendering partial '#{options[:partial]}'" | |
output = "<!-- START #{debug_output} -->\n#{output}\n<!-- END #{debug_output} -->" | |
end | |
output | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment