Created
November 30, 2012 09:15
-
-
Save todesking/4174687 to your computer and use it in GitHub Desktop.
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
Application.configure do | |
config.after_initialize do | |
# Partialの情報をHTMLに埋める | |
# For ActionPack 3.2.8 | |
class ActionView::PartialRenderer | |
def render_with_partial_annotation(*args) | |
setup(*args) | |
path = @path | |
content = "".html_safe | |
content << "<!- BEGIN: #{path} -->\n".html_safe if path | |
content << render_without_partial_annotation(*args) | |
content << "<!- END: #{path} -->\n".html_safe if path | |
content | |
end | |
alias_method_chain :render, :partial_annotation | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment