Module: ActionView::Rendering

Defined in:
lib/template_wrapper/mixins/rails3.rb

Instance Method Summary collapse

Instance Method Details

#_render_template(template, layout = nil, options = {}) ⇒ Object

Renders the given template. An string representing the layout can be supplied as well.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/template_wrapper/mixins/rails3.rb', line 7

def _render_template(template, layout = nil, options = {}) #:nodoc:
#  puts "ActionView::Rendering._render_template : #{template.inspect}" 
  locals = options[:locals] || {}
  layout = find_layout(layout) if layout

  ActiveSupport::Notifications.instrument("render_template.action_view",
    :identifier => template.identifier, :layout => layout.try(:virtual_path)) do

    content = template.render(self, locals) { |*name| _layout_for(*name) }
    @_content_for[:layout] = content if layout

    content = _render_layout(layout, locals) if layout
    
    TemplateWrapper::wrap(template.inspect, content)
  end
end