class ActionView::Pathfinder::Template
Public Class Methods
new(template)
click to toggle source
Calls superclass method
# File lib/actionview/pathfinder/template.rb, line 5 def initialize(template) super @template = template end
Public Instance Methods
render(view, locals, buffer=nil, &block)
click to toggle source
adds an html comment at the beginning and end of each template, when rendering, that contains the path to that view file.
Calls superclass method
# File lib/actionview/pathfinder/template.rb, line 13 def render(view, locals, buffer=nil, &block) @template.instance_variable_set(:'@source', wrapped_source) super(view, locals, buffer, &block) end
Private Instance Methods
handler_type()
click to toggle source
# File lib/actionview/pathfinder/template.rb, line 41 def handler_type @handler_type ||= handler.to_s. split('::').first.downcase end
html_comment(text)
click to toggle source
# File lib/actionview/pathfinder/template.rb, line 31 def html_comment(text) return '' unless formats.include?(:html) if handler_type == 'haml' ["/ ", text, "\n\n"].join('') else ["\n<!-- ", text, " -->\n"].join('') end end
wrapped_source()
click to toggle source
# File lib/actionview/pathfinder/template.rb, line 21 def wrapped_source path = virtual_path.to_s [ html_comment(path), source, html_comment("end of #{path}") ].join('') end