Module: Facebooker2::Rails::Helpers::RequestForms

Included in:
Facebooker2::Rails::Helpers
Defined in:
lib/facebooker2/rails/helpers/request_forms.rb

Instance Method Summary collapse

Instance Method Details

#fb_forgery_protection_token_tagObject



21
22
23
24
25
26
27
# File 'lib/facebooker2/rails/helpers/request_forms.rb', line 21

def fb_forgery_protection_token_tag
  unless protect_against_forgery?
    ''
  else
    tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token)
  end
end

#fb_multi_friend_selector(message, options = {}, &block) ⇒ Object



9
10
11
12
# File 'lib/facebooker2/rails/helpers/request_forms.rb', line 9

def fb_multi_friend_selector(message,options={},&block)
  options = fb_stringify_vals({:showborder=>false,:actiontext=>message,:max=>20}.merge(options.dup))
  tag("fb:multi-friend-selector",options)
end

#fb_req_choice(label, url) ⇒ Object



5
6
7
# File 'lib/facebooker2/rails/helpers/request_forms.rb', line 5

def fb_req_choice(label,url)
  tag "fb:req-choice",:label=>label,:url=>url
end

#fb_request_form(type, url, message, options = {}, &block) ⇒ Object



14
15
16
17
18
# File 'lib/facebooker2/rails/helpers/request_forms.rb', line 14

def fb_request_form(type,url,message,options={},&block)
  content = capture(&block)
  concat(("fb:request-form", content.to_s + fb_forgery_protection_token_tag,
            {:action=>url,:method=>"post",:invite=>true,:type=>type,:content=>message}.merge(options)))
end