Class: ActionView::LogSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/log_overrider.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) render_template(event) Also known as: render_partial, render_collection



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/log_overrider.rb', line 2

def render_template(event)
  count = event.payload[:count] || 1
  hash = {:event    => :render,
          :template => from_rails_root(event.payload[:identifier]),
          :total_ms => event.duration,
          :count    => count,
          :ms       => event.duration / count}

  hash.merge(:layout => event.payload[:layout]) if event.payload[:layout]

  Rails.logger.info(hash)
end