Module: FacebookRegistrationHelper::InstanceMethods

Defined in:
lib/helpers/helpers.rb

Constant Summary collapse

DefaultValues =
{"fields" =>"name,email,password", "redirect-uri"=>"http://localhost:3000/fb_registration", "fb_only" => false, "width" => "100%", "height" => nil, "onvalidate" =>nil}

Instance Method Summary collapse

Instance Method Details

#fb_registration_form(options = {}) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'lib/helpers/helpers.rb', line 15

def fb_registration_form(options={})
  options = DefaultValues.merge(options).delete_if { |key, value| value.nil? }
  
  str = "<fb:registration"
  options.each_pair do |key, value|
    str += " #{key} = \"#{value}\""
  end
  str += "> </fb:registration>"
end

#init_fb_registration(app_id = nil) ⇒ Object


10
11
12
13
# File 'lib/helpers/helpers.rb', line 10

def init_fb_registration(app_id=nil)
  raise "Must set Application ID for initializing" unless app_id
  "<div id=\"fb-root\"></div> \n <script src=\"http://connect.facebook.net/en_US/all.js#appId=#{app_id}&xfbml=1\"></script> \n <script src=\"http://code.jquery.com/jquery-1.4.4.min.js\"></script>"
end