[Facebooker-talk] FB Canvas Controller
Mike Mangino
mmangino at elevatedrails.com
Tue Sep 16 17:52:42 EDT 2008
What is your canvaspath in Facebook? It can't use localhost because
Facebook needs to be able to talk to your webserver. You'll need to
open up access to your server. I created the Tunnlr service to make
this easy (http://tunnlr.com)
Check out http://www.pragprog.com/titles/mmfacer for my book on
Facebook development. I know there is one By from peepcode as well.
Mike
On Sep 16, 2008, at 4:53 PM, William Thomas wrote:
> I'm having a terrible time figuring this out. I think I am missing
> something key to the entire workings of Facebooker. I've created a
> sample application to test things out and am failing miserably.
>
> When I try to access a controller that requires the app installed I
> am sent to facebook allowed to authorize the app and then get the
> message below. What I believe should happen is the facebook_aware/
> index.fbml.erb file should be displayed.
>
> "
> Error while loading page from facebookSandbox
>
> The URL http://localhost:3000/facebook_aware/?auth_token=[this is
> really the auth token]&installed=1 is not valid.
>
> There are still a few kinks Facebook and the makers of
> facebookSandbox are trying to iron out. We appreciate your patience
> as we try to fix these issues. Your problem has been logged - if it
> persists, please come back in a few days. Thanks!
> "
>
> here are what I believe are the relavent pieces of my app
>
> routes.rb:
> map.connect 'facebook_aware',:controller =>
> "facebook_aware", :conditions => {:canvas => true}
>
> development:
> canvas_page_name: facebook_aware
> callback_url: http://localhost:3000/facebook_aware/
>
> facebook_aware_controller.rb:
> class FacebookAwareController < ApplicationController
>
> before_filter :ensure_application_is_installed_by_facebook_user
> before_filter :ensure_authenticated_to_facebook
> before_filter :ensure_has_status_update, :only =>
> [:add_status_update]
>
> def add_status_update
> redirect_to :action => 'done'
> end
>
> end
>
> (map.root) index.html.erb:
> This is where I ask the user to "add" the facebook component
> <%= link_to "Use Facebook" , {:controller =>
> "facebook_aware",:action => "index" } %>
>
--
Mike Mangino
http://www.elevatedrails.com
More information about the Facebooker-talk
mailing list