George Deglin
2008-Aug-05 22:18 UTC
[Facebooker-talk] Bug when loading FBML through FB-Ajax
I ran across a bug a little while ago where link_to''s in generated content were not in the scope of the application callback url. This is because facebook does not pass the "fb_sig_in_canvas" parameter for ajax requests (but it does pass fb_sig_is_ajax) The following is the fix that I used: diff --git a/lib/facebooker/rails/ facebook_url_rewriting.rb b/lib/facebooker/rails/facebook_url_rewriting.rb index 72807db..7dad529 100644 --- a/lib/facebooker/rails/facebook_url_rewriting.rb +++ b/lib/facebooker/rails/facebook_url_rewriting.rb @@ -13,7 +13,7 @@ module ::ActionController def link_to_canvas?(params, options) option_override = options[:canvas] return false if option_override == false # important to check for false. nil should use default behavior - option_override || @request.parameters["fb_sig_in_canvas"] == "1" || @request.parameters[:fb_sig_in_canvas] == "1" + option_override || (@request.parameters["fb_sig_in_canvas"] == "1") || (@request.parameters[:fb_sig_in_canvas] == "1") || (@request.parameters[:fb_sig_is_ajax]=="1") end def rewrite_url_with_facebooker(*args) Can anyone confirm that this looks like the right way to do it? It''d be nice to get this fixed in the official branch but I''m not sure if there might be something I overlooked. Best, George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080805/cc746b6d/attachment.html>