Class: SocialButtons::Like::Scripter
- Inherits:
-
Scripter
- Object
- Scripter
- SocialButtons::Like::Scripter
show all
- Defined in:
- lib/social_buttons/view_helpers/like.rb
Instance Attribute Summary
Attributes inherited from Scripter
#caller, #options
Instance Method Summary
collapse
Methods inherited from Scripter
#initialize
Instance Method Details
#js_sdk(options = {}) ⇒ Object
43
44
45
46
|
# File 'lib/social_buttons/view_helpers/like.rb', line 43
def js_sdk options = {}
loc = options[:locale] || 'en_US'
"https://connect.facebook.net/" + loc + "/all.js"
end
|
#script(app_id, options = {}) ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/social_buttons/view_helpers/like.rb', line 34
def script(app_id, options = {})
return empty_content if widgetized? :like
widgetized! :like
[
"<script src=#{js_sdk options} type='text/javascript'></script>",
"<script>FB.init({ appId: '#{app_id}', status: true, cookie: true, xfbml: true });</script>",
].join.html_safe
end
|