Module: ClankerSupport::Helper

Defined in:
lib/clankersupport/railtie.rb

Overview

View helper mixed into ActionView by the Railtie.

<%= clanker_support_tag %>                        <%# uses ENV["CLANKER_PROJECT_KEY"] %>
<%= clanker_support_tag "pk_abc123", theme: "auto" %>

Instance Method Summary collapse

Instance Method Details

#clanker_support_tag(project_key = nil, **options) ⇒ Object

Render the widget script tag, marked html_safe so Rails' ERB autoescaping emits it as markup. The project key defaults to ENV["CLANKER_PROJECT_KEY"].



16
17
18
19
# File 'lib/clankersupport/railtie.rb', line 16

def clanker_support_tag(project_key = nil, **options)
	key = project_key || ENV["CLANKER_PROJECT_KEY"]
	ClankerSupport.script_tag(key, **options).html_safe
end