haml_filename_comment.rb 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 Show hidden characters Haml :: Engine . class_eval do alias_method :initialize_without_file_comments , :initialize def initialize ( template , options = { } ) template = template . dup template . insert ( 0 , "/ BEGIN #{ options [ :filename ] } \n " ) template . insert ( - 1 , " \n / END #{ options [ :filename ] } " ) template . freeze initialize_without_file_comments ( template , options ) end end if Rails . env . development?