Module: Immunio::TemplateHooks

Extended by:
ActiveSupport::Concern
Defined in:
lib/immunio/plugins/action_view/template_rendering.rb

Overview

Hook for the ‘ActionView::Template`. These are called for non-root templates.

Instance Method Summary collapse

Instance Method Details

#render_with_immunio(context, *args, &block) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/immunio/plugins/action_view/template_rendering.rb', line 33

def render_with_immunio(context, *args, &block)
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    renderer = Template.new(self)

    renderer.render context do
      Request.pause "plugin", "#{Module.nesting[0]}::#{__method__}" do
        render_without_immunio(context, *args, &block)
      end
    end
  end
end