Module: ProductTours::WidgetHelper

Defined in:
lib/product_tours/widget_helper.rb

Overview

Included into the host's ActionView. This lives under lib and is required before the engine registers its Action View load hook: a host initializer may load Action View before Rails sets up application autoloaders, when an app/helpers constant cannot be resolved yet.

Instance Method Summary collapse

Instance Method Details

#product_tours_tagObject



9
10
11
12
13
14
15
16
# File 'lib/product_tours/widget_helper.rb', line 9

def product_tours_tag
  return unless ProductTours.enabled?(request)

  ProductTours::Widget.snippet(
    locale: ProductTours.locale(request),
    nonce: (content_security_policy_nonce if respond_to?(:content_security_policy_nonce))
  ).html_safe
end