Module: Peteshow::Helpers

Defined in:
lib/peteshow/helpers.rb

Instance Method Summary collapse

Instance Method Details

#peteshow_include_tag(*args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/peteshow/helpers.rb', line 3

def peteshow_include_tag(*args)
  config = Peteshow.config
  country = args.first.is_a?(String) ? args.shift : nil
  options = args.first || {}

  return unless config.enabled == true

  tags = []
  tags << javascript_include_tag('peteshow.min.js',     options)
  tags << javascript_include_tag("peteshow.#{country}", options) if country
  tags << stylesheet_link_tag('peteshow')

  tags.join.html_safe
end