Skip to content
Example of a Facebook canvas app on Rails with a bunch of fixes, hacks, and workarounds for common problems
Ruby CoffeeScript JavaScript
Latest commit 3669461 Mar 12, 2012 @cmer added demo url
Failed to load latest commit information.
app Skip filters Mar 12, 2012
config initial commit Mar 12, 2012
db initial commit Mar 12, 2012
doc initial commit Mar 12, 2012
public initial commit Mar 12, 2012
script initial commit Mar 12, 2012
vendor initial commit Mar 12, 2012
Gemfile initial commit Mar 12, 2012


This is a sample Facebook Canvas App built with Ruby on Rails 3.2. It demonstrates workarounds, fixes and hacks to solve some of the most frequently encountered problems with Facebook Canvas applications.


  • Fixes broken back button in IFrame (uses PushState for smart browsers, and for IE)
  • Handles disabled 3rd party cookies gracefully (ie: maintain session even when cookies are disabled)
  • Properly sets the P3P header for Internet Explorer
  • Handles Facebook's signed_request POST transparently
  • OAuth Authentication
  • Sends CSRF token with AJAX requests
  • CJAX script to for PushState. CJAX uses History.js under the hood and was heavily influenced by History.js and PJAX.


You can see this code in action at

Something went wrong with that request. Please try again.