using Rails 4 for facebook app?

96 Views Asked by At

Ok I've been trying to research how to enable my site to work within a facebook canvas app as its just showing up as a blank. I found this website tut which seemed to shed a bit of light on why it wasnt working: Here and here is the git

I'm not sure how to call this from my site, i've uploaded the doc to the server but how do i use it? I can only do PHP, a bit of mySQL, html and jquery etc... My knowledge doesnt span this far.

Any advice would be much appreciated heres the code that i need to function on my server:

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
1

There are 1 best solutions below

0
On

I followed this tutorial: https://coderwall.com/p/bsfitw

Then I put:

  after_filter :allow_iframe

In the first line of all my controllers classes

And:

  private
  def allow_iframe
  response.headers["X-Frame-Options"] = "GOFORIT"
  end

At the bottom.

I also added a post route to "/"

#config/routes.rb
  post '/', to: 'mycontroller#mymethod'

Source: https://coderwall.com/p/toddiq