Module: SocialButtons::Vkontakte

Includes:
Assistant
Defined in:
lib/social_buttons/view_helpers/vkontakte.rb

Defined Under Namespace

Classes: Scripter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_optionsObject



19
20
21
22
23
24
25
26
27
# File 'lib/social_buttons/view_helpers/vkontakte.rb', line 19

def default_options
  @default_options ||= {
    width: '350',
    type: 'vertical',
    verb: '0',
    height: '22',
    verb: '0'
  }
end

Instance Method Details

#vkontakte_like(appId, *args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/social_buttons/view_helpers/vkontakte.rb', line 5

def vkontakte_like appId, *args
  clazz = SocialButtons::Vkontakte
  options = args.extract_options!
  
  clazz.default_options.each { |k,v| options[k] ||= v }

  html = "".html_safe
  html << clazz::Scripter.new(self).init_js(appId)
  html << (:div, nil, id: "vk_like")
  html << clazz::Scripter.new(self).script(options)
  html
end