Module: Sinatra::ReFacebookHelper
- Defined in:
- lib/refacebook/sinatra.rb
Instance Method Summary collapse
-
#fbml_redirect(url) ⇒ Object
Since redirect doesn’t work in the canvas since it relies on JavaScript Location field.
-
#in_canvas? ⇒ Boolean
If in the facebook canvas returns true.
-
#link_from_canvas(path = "/") ⇒ Object
Return a concatenated url with the canvas url and the path.
Instance Method Details
#fbml_redirect(url) ⇒ Object
Since redirect doesn’t work in the canvas since it relies on JavaScript Location field. This is a replacement which uses fbml as a means to redirect to the given url.
20 21 22 |
# File 'lib/refacebook/sinatra.rb', line 20 def fbml_redirect(url) halt "<fb:redirect url=\"#{url}\" />" end |
#in_canvas? ⇒ Boolean
If in the facebook canvas returns true
7 8 9 |
# File 'lib/refacebook/sinatra.rb', line 7 def in_canvas? params["fb_sig_in_canvas"].eql? "1" end |
#link_from_canvas(path = "/") ⇒ Object
Return a concatenated url with the canvas url and the path
12 13 14 15 |
# File 'lib/refacebook/sinatra.rb', line 12 def link_from_canvas(path="/") path = path.eql?("/") ? "" : "/#{path}" "#{.canvas_url}#{path}" end |