3

I'm trying to learn how to create a facebook canvas app using ruby/rails and develop it locally.

I create a new demo app and launch the server on my local machine at localhost:3000 then I create a new facebook app and point the Canvas URL to localhost:3000. Note that I check the sandbox enabled option and do not provide a secure Canvas URL.

As I try to access the app's Canvas page on facebook I see the following error displayed:

Routing Error

No route matches [POST] "/"

Try running rake routes for more information on available routes.

Note that when I access the app locally at localhost:3000 I do not get the error. I just simply see the usual default "Welcome Aboard" page from a newly created rails app.

Can anyone please pinpoint me to a solution or set of proper instructions on how to set up a local environment for fb canvas development? Any help would be much appreciated.

user1206050
  • 141
  • 1
  • 1
  • 3

1 Answers1

0

Your server or app isn't configured correctly to process the HTTP POST request from Facebook - I'm not familiar with how rails is configured but this blog post seems to offer a workaround: http://blog.coderubik.com/2011/03/restful-facebook-canvas-app-with-rails-and-post-for-canvas/

Note that the initial request to load your app will always be a POST request - this contains a signed_request value with data your app uses to know who the current users is - https://developers.facebook.com/docs/howtos/login/signed-request/ has more details

Igy
  • 43,710
  • 8
  • 89
  • 115