Module: FacebookDialog::ScriptHelper

Defined in:
lib/facebook_dialog/script_helper.rb

Instance Method Summary collapse

Instance Method Details

#fb_init_js(options = {}) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/facebook_dialog/script_helper.rb', line 8

def fb_init_js(options = {})
  default_options = {
    appId: FacebookDialog.api_key,
    status: true,
    cookies: true
  }
  "FB.init(#{options.merge(default_options).to_json.html_safe});".html_safe
end

#fb_jsObject



3
4
5
6
# File 'lib/facebook_dialog/script_helper.rb', line 3

def fb_js
  (:div, "", id: "fb-root") +
  javascript_include_tag('//connect.facebook.net/en_US/all.js')
end