Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Facebook page and canvas apps with Rails 4, can lead to a blank white page. In Rails 4, the X-Frame-Options are sets by default, and you should override them, to allow iframes in Rails.
class FacebookClubsController < ApplicationController
layout "facebook_canvas"
after_filter :allow_iframe
def index
end
private
def allow_iframe
response.headers["X-Frame-Options"] = "GOFORIT"
end
end
@ksylvest

This comment has been minimized.

Copy link

commented Jun 18, 2013

Note:

It is probably a bit safer to whitelist to the facebook domain using:

response.headers['X-Frame-Options'] = "ALLOW-FROM https://www.facebook.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.