Skip to content

Instantly share code, notes, and snippets.

@kylemac
Created April 18, 2011 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylemac/926110 to your computer and use it in GitHub Desktop.
Save kylemac/926110 to your computer and use it in GitHub Desktop.
A quick helper method to accommodate FB iframe app's on Pages
require 'sinatra/base'
module Sinatra
module FBHelper
def fb_tab(path, opts={}, &block)
post(path, opts, &block)
get(path, opts, &block)
end
end
end
class App < Sinatra::Base
register Sinatra::FBHelper
# fb_tab() extends the traditional get() or post() methods
# to accommodate Facebook's use of POST for loading iframe tabs
fb_tab '/' do
'Hello World'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment