Module: Yashare::Helpers

Extended by:
ActiveSupport::Concern
Defined in:
lib/yashare/helpers.rb

Instance Method Summary collapse

Instance Method Details

#yashare(opts = {}) ⇒ Object



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

def yashare(opts = {})
  attrs = {
    charset: 'utf-8',
    type:    'text/javascript',
    src:     '//yastatic.net/share/share.js'
  }

  script = (:script, nil, attrs)
  widget = Yashare::Widget.new(self, opts)
  html = [script, widget].join("\n")

  raw(html)
end