Method: ActionView::Template#render

Defined in:
actionpack/lib/action_view/template.rb

#render(view, locals, buffer = nil, &block) ⇒ Object

Render a template. If the template was not compiled yet, it is done exactly before rendering.

This method is instrumented as “!render_template.action_view”. Notice that we use a bang in this instrumentation because you don’t want to consume this in production. This is only slow if it’s being listened to.



141
142
143
144
145
146
147
148
# File 'actionpack/lib/action_view/template.rb', line 141

def render(view, locals, buffer=nil, &block)
  ActiveSupport::Notifications.instrument("!render_template.action_view", :virtual_path => @virtual_path) do
    compile!(view)
    view.send(method_name, locals, buffer, &block)
  end
rescue Exception => e
  handle_render_error(view, e)
end