lib/yashare/helpers.rb in yashare-0.1 vs lib/yashare/helpers.rb in yashare-0.9
- old
+ new
@@ -1,18 +1,19 @@
module Yashare
module Helpers
extend ActiveSupport::Concern
- def yashare(opts={})
- script = content_tag(:script, nil,
+ def yashare(opts = {})
+ attrs = {
charset: 'utf-8',
type: 'text/javascript',
src: '//yastatic.net/share/share.js'
- )
+ }
- div = content_tag(:div)
+ script = content_tag(:script, nil, attrs)
+ widget = Yashare::Widget.new(self, opts)
+ html = [script, widget].join("\n")
- html = [script, Yashare::Widget.new(self, opts)].join("\n")
- self.raw(html)
+ raw(html)
end
end
end