Hi, everyone, I am the new one for the facebooker and just created my facebook application. I start my first application by following the facebooker_tutorial and use heroku as my host. My application works fine in "Iframe" mode, but when I turn to "FBML" mode, I recieved 406 error from my host. Does someone has any idea? I think maybe I do something wrong in my facebooker configuration. Here is my facebooker.yml configuration: api_key: xxxxxxxxxxxxxxxxxxx secret_key: xxxxxxxxxxxxxxxxxxxx canvas_page_name: /favoritelink/ callback_url: http://skygroup.heroku.com:80 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080710/890c0a76/attachment-0001.html>
First thing to try is removing the slashes from the canvas_page_name.... If that doesn''t help can you send more details from your rails log? Dave On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote:> Hi, everyone, > I am the new one for the facebooker and just created my facebook > application. > I start my first application by following the facebooker_tutorial and > use heroku as my host. > My application works fine in "Iframe" mode, but when I turn to "FBML" > mode, I recieved 406 error from my host. > Does someone has any idea? I think maybe I do something wrong in my > facebooker configuration. > > Here is my facebooker.yml configuration: > api_key: xxxxxxxxxxxxxxxxxxx secret_key: xxxxxxxxxxxxxxxxxxxx > canvas_page_name: /favoritelink/ > callback_url: http://skygroup.heroku.com:80 > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080709/cb56be04/attachment.html>
Current configuration: api_key: 1cf93933582d5835bebe98d286158273 secret_key: 2863b13fc58f57cae527de45fd4b7f20 canvas_page_name: favoritelink callback_url: http://skygroup.heroku.com:80 Facebook Error message: Errors while loading page from application Received HTTP error code 406 while loading http://skygroup.heroku.com/ Hosting Logs: Processing UsersController#index (for 204.15.23.168 at 2008-07-09 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 Parameters: {"fb_sig_time"=>"1215663521.2908", "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", "fb_sig_locale"=>"en_US", "action"=>"index", "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", "fb_sig_request_method"=>"GET", "controller"=>"users", "fb_sig_expires"=>"0", "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable [ http://skygroup.heroku.com/] ?08-7-10?David Clements <digidigo at gmail.com> ???> > First thing to try is removing the slashes from the canvas_page_name.... > > If that doesn''t help can you send more details from your rails log? > > Dave > > > On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: > >> Hi, everyone, >> I am the new one for the facebooker and just created my facebook >> application. >> I start my first application by following the facebooker_tutorial and >> use heroku as my host. >> My application works fine in "Iframe" mode, but when I turn to "FBML" >> mode, I recieved 406 error from my host. >> Does someone has any idea? I think maybe I do something wrong in my >> facebooker configuration. >> >> Here is my facebooker.yml configuration: >> api_key: xxxxxxxxxxxxxxxxxxx secret_key: xxxxxxxxxxxxxxxxxxxx >> canvas_page_name: /favoritelink/ >> callback_url: http://skygroup.heroku.com:80 >> >> >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080710/efd30c0b/attachment.html>
Do you have a .fbml.erb template for your action? It looks like Rails doesn''t know how to respond to that request. Mike On Jul 10, 2008, at 12:22 AM, ?? wrote:> Current configuration: > api_key: 1cf93933582d5835bebe98d286158273 > secret_key: 2863b13fc58f57cae527de45fd4b7f20 > canvas_page_name: favoritelink > callback_url: http://skygroup.heroku.com:80 > > Facebook Error message: > Errors while loading page from application > Received HTTP error code 406 while loading http://skygroup.heroku.com/ > > Hosting Logs: > Processing UsersController#index (for 204.15.23.168 at 2008-07-09 > 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 > Parameters: {"fb_sig_time"=>"1215663521.2908", > "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", > "fb_sig_locale"=>"en_US", "action"=>"index", > "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", > "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", > "fb_sig_request_method"=>"GET", "controller"=>"users", > "fb_sig_expires"=>"0", > "fb_sig_friends > "= > > > "2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794 > ", "fb_sig_added"=>"0", > "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", > "fb_sig_profile_update_time"=>"1211120190", > "fb_sig_user"=>"830843210"} > User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 > reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not > Acceptable [http://skygroup.heroku.com/] > > > > ?08-7-10?David Clements > <digidigo at gmail.com> ??? First > thing to try is removing the slashes from the canvas_page_name.... > > If that doesn''t help can you send more details from your rails log? > > Dave > > > On Wed, Jul 9, 2008 at 10:00 PM, ?? > <xiuxiu.luo.xiao at gmail.com> wrote: > Hi, everyone, > I am the new one for the facebooker and just created my facebook > application. > I start my first application by following the > facebooker_tutorial and use heroku as my host. > My application works fine in "Iframe" mode, but when I turn to > "FBML" mode, I recieved 406 error from my host. > Does someone has any idea? I think maybe I do something wrong in > my facebooker configuration. > > Here is my facebooker.yml configuration: > api_key: xxxxxxxxxxxxxxxxxxx > secret_key: xxxxxxxxxxxxxxxxxxxx > canvas_page_name: /favoritelink/ > callback_url: http://skygroup.heroku.com:80 > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
I just followed http://apps.facebook.com/facebooker_tutorial/. And now I think the root cause is the controller which the tutorial doesn''t mention a lot. Now my controller action looks like: def add_facebook_application @users = User.find(:all) end It''s fine. I used to write my controller like: def add_facebook_application @users = User.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end This version causes the 406 error. So What kind of MIME type should I return for the FBML request? 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>:> Do you have a .fbml.erb template for your action? It looks like Rails > doesn''t know how to respond to that request. > > Mike > > > On Jul 10, 2008, at 12:22 AM, ?? wrote: > > Current configuration: >> api_key: 1cf93933582d5835bebe98d286158273 >> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >> canvas_page_name: favoritelink >> callback_url: http://skygroup.heroku.com:80 >> >> Facebook Error message: >> Errors while loading page from application >> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >> >> Hosting Logs: >> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >> Parameters: {"fb_sig_time"=>"1215663521.2908", >> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >> "fb_sig_locale"=>"en_US", "action"=>"index", >> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >> "fb_sig_request_method"=>"GET", "controller"=>"users", >> "fb_sig_expires"=>"0", >> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >> [http://skygroup.heroku.com/] >> >> >> >> ?08-7-10?David Clements <digidigo at gmail.com> ??? First thing to try is >> removing the slashes from the canvas_page_name.... >> >> If that doesn''t help can you send more details from your rails log? >> >> Dave >> >> >> On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >> Hi, everyone, >> I am the new one for the facebooker and just created my facebook >> application. >> I start my first application by following the facebooker_tutorial and >> use heroku as my host. >> My application works fine in "Iframe" mode, but when I turn to "FBML" >> mode, I recieved 406 error from my host. >> Does someone has any idea? I think maybe I do something wrong in my >> facebooker configuration. >> >> Here is my facebooker.yml configuration: >> api_key: xxxxxxxxxxxxxxxxxxx >> secret_key: xxxxxxxxxxxxxxxxxxxx >> canvas_page_name: /favoritelink/ >> callback_url: http://skygroup.heroku.com:80 >> >> >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080711/fde7cacc/attachment.html>
fbml is the format type for canvas requests. Dave On Thu, Jul 10, 2008 at 9:30 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote:> I just followed http://apps.facebook.com/facebooker_tutorial/. > And now I think the root cause is the controller which the tutorial doesn''t > mention a lot. > > Now my controller action looks like: > def add_facebook_application @users = User.find(:all) > end > It''s fine. > > I used to write my controller like: > def add_facebook_application @users = User.find(:all) > respond_to do |format| format.html # index.html.erb > format.xml { render :xml => @users } > end > end > This version causes the 406 error. > > So What kind of MIME type should I return for the FBML request? > > > 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: > > Do you have a .fbml.erb template for your action? It looks like Rails >> doesn''t know how to respond to that request. >> >> Mike >> >> >> On Jul 10, 2008, at 12:22 AM, ?? wrote: >> >> Current configuration: >>> api_key: 1cf93933582d5835bebe98d286158273 >>> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >>> canvas_page_name: favoritelink >>> callback_url: http://skygroup.heroku.com:80 >>> >>> Facebook Error message: >>> Errors while loading page from application >>> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >>> >>> Hosting Logs: >>> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >>> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >>> Parameters: {"fb_sig_time"=>"1215663521.2908", >>> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >>> "fb_sig_locale"=>"en_US", "action"=>"index", >>> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >>> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >>> "fb_sig_request_method"=>"GET", "controller"=>"users", >>> "fb_sig_expires"=>"0", >>> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >>> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >>> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >>> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >>> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >>> [http://skygroup.heroku.com/] >>> >>> >>> >>> ?08-7-10?David Clements <digidigo at gmail.com> ??? First thing to try is >>> removing the slashes from the canvas_page_name.... >>> >>> If that doesn''t help can you send more details from your rails log? >>> >>> Dave >>> >>> >>> On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >>> Hi, everyone, >>> I am the new one for the facebooker and just created my facebook >>> application. >>> I start my first application by following the facebooker_tutorial and >>> use heroku as my host. >>> My application works fine in "Iframe" mode, but when I turn to "FBML" >>> mode, I recieved 406 error from my host. >>> Does someone has any idea? I think maybe I do something wrong in my >>> facebooker configuration. >>> >>> Here is my facebooker.yml configuration: >>> api_key: xxxxxxxxxxxxxxxxxxx >>> secret_key: xxxxxxxxxxxxxxxxxxxx >>> canvas_page_name: /favoritelink/ >>> callback_url: http://skygroup.heroku.com:80 >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >>> >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>> >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080710/f2036f3b/attachment-0001.html>
How should I set my controller for fbml? Can you give me an example? I just tried "format.fbml", and failed. Or should I do some configuration? 2008/7/11, David Clements <digidigo at gmail.com>:> > fbml is the format type for canvas requests. > > Dave > > > On Thu, Jul 10, 2008 at 9:30 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: > >> I just followed http://apps.facebook.com/facebooker_tutorial/. >> And now I think the root cause is the controller which the tutorial >> doesn''t mention a lot. >> >> Now my controller action looks like: >> def add_facebook_application @users = User.find(:all) >> end >> It''s fine. >> >> I used to write my controller like: >> def add_facebook_application @users = User.find(:all) >> respond_to do |format| format.html # index.html.erb >> format.xml { render :xml => @users } >> end >> end >> This version causes the 406 error. >> >> So What kind of MIME type should I return for the FBML request? >> >> >> 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: >> >> Do you have a .fbml.erb template for your action? It looks like Rails >>> doesn''t know how to respond to that request. >>> >>> Mike >>> >>> >>> On Jul 10, 2008, at 12:22 AM, ?? wrote: >>> >>> Current configuration: >>>> api_key: 1cf93933582d5835bebe98d286158273 >>>> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >>>> canvas_page_name: favoritelink >>>> callback_url: http://skygroup.heroku.com:80 >>>> >>>> Facebook Error message: >>>> Errors while loading page from application >>>> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >>>> >>>> Hosting Logs: >>>> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >>>> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >>>> Parameters: {"fb_sig_time"=>"1215663521.2908", >>>> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >>>> "fb_sig_locale"=>"en_US", "action"=>"index", >>>> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >>>> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >>>> "fb_sig_request_method"=>"GET", "controller"=>"users", >>>> "fb_sig_expires"=>"0", >>>> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >>>> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >>>> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >>>> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >>>> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >>>> [http://skygroup.heroku.com/] >>>> >>>> >>>> >>>> ?08-7-10?David Clements <digidigo at gmail.com> ??? First thing to try is >>>> removing the slashes from the canvas_page_name.... >>>> >>>> If that doesn''t help can you send more details from your rails log? >>>> >>>> Dave >>>> >>>> >>>> On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >>>> Hi, everyone, >>>> I am the new one for the facebooker and just created my facebook >>>> application. >>>> I start my first application by following the facebooker_tutorial and >>>> use heroku as my host. >>>> My application works fine in "Iframe" mode, but when I turn to "FBML" >>>> mode, I recieved 406 error from my host. >>>> Does someone has any idea? I think maybe I do something wrong in my >>>> facebooker configuration. >>>> >>>> Here is my facebooker.yml configuration: >>>> api_key: xxxxxxxxxxxxxxxxxxx >>>> secret_key: xxxxxxxxxxxxxxxxxxxx >>>> canvas_page_name: /favoritelink/ >>>> callback_url: http://skygroup.heroku.com:80 >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> -- >>> Mike Mangino >>> http://www.elevatedrails.com >>> >>> >>> >>> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080711/64243ebc/attachment.html>
Are you actually using the format.xml? If not, just remove the whole respond_to block and it will attempt to render index.fbml.erb. Mike On Jul 11, 2008, at 1:13 AM, ?? wrote:> How should I set my controller for fbml? Can you give me an example? > > I just tried "format.fbml", and failed. Or should I do some > configuration? > > 2008/7/11, David Clements <digidigo at gmail.com>: fbml is the format > type for canvas requests. > > Dave > > > > On Thu, Jul 10, 2008 at 9:30 PM, ?? > <xiuxiu.luo.xiao at gmail.com> wrote: > I just followed http://apps.facebook.com/facebooker_tutorial/. > And now I think the root cause is the controller which the tutorial > doesn''t mention a lot. > > Now my controller action looks like: > def add_facebook_application > @users = User.find(:all) > end > It''s fine. > > I used to write my controller like: > def add_facebook_application > @users = User.find(:all) > respond_to do |format| > format.html # index.html.erb > format.xml { render :xml => @users } > end > end > This version causes the 406 error. > > So What kind of MIME type should I return for the FBML request? > > > 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: > > Do you have a .fbml.erb template for your action? It looks like > Rails doesn''t know how to respond to that request. > > Mike > > > On Jul 10, 2008, at 12:22 AM, ?? wrote: > > Current configuration: > api_key: 1cf93933582d5835bebe98d286158273 > secret_key: 2863b13fc58f57cae527de45fd4b7f20 > canvas_page_name: favoritelink > callback_url: http://skygroup.heroku.com:80 > > Facebook Error message: > Errors while loading page from application > Received HTTP error code 406 while loading http://skygroup.heroku.com/ > > Hosting Logs: > Processing UsersController#index (for 204.15.23.168 at 2008-07-09 > 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 > Parameters: {"fb_sig_time"=>"1215663521.2908", > "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", > "fb_sig_locale"=>"en_US", "action"=>"index", > "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", > "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", > "fb_sig_request_method"=>"GET", "controller"=>"users", > "fb_sig_expires"=>"0", > "fb_sig_friends > "= > > > "2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794 > ", "fb_sig_added"=>"0", > "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", > "fb_sig_profile_update_time"=>"1211120190", > "fb_sig_user"=>"830843210"} > User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 > reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not > Acceptable [http://skygroup.heroku.com/] > > > > ?08-7-10?David Clements > <digidigo at gmail.com> ??? First > thing to try is removing the slashes from the canvas_page_name.... > > If that doesn''t help can you send more details from your rails log? > > Dave > > > On Wed, Jul 9, 2008 at 10:00 PM, ?? > <xiuxiu.luo.xiao at gmail.com> wrote: > Hi, everyone, > I am the new one for the facebooker and just created my facebook > application. > I start my first application by following the facebooker_tutorial > and use heroku as my host. > My application works fine in "Iframe" mode, but when I turn to > "FBML" mode, I recieved 406 error from my host. > Does someone has any idea? I think maybe I do something wrong in > my facebooker configuration. > > Here is my facebooker.yml configuration: > api_key: xxxxxxxxxxxxxxxxxxx > secret_key: xxxxxxxxxxxxxxxxxxxx > canvas_page_name: /favoritelink/ > callback_url: http://skygroup.heroku.com:80 > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > > > > >-- Mike Mangino http://www.elevatedrails.com
This is how the tutorial code works. If the request is for a canvas page it will attempt to render index.fbml.erb, otherwise it will render index.html.erb ... no need for a render block. On Fri, Jul 11, 2008 at 5:54 AM, Mike Mangino <mmangino at elevatedrails.com> wrote:> Are you actually using the format.xml? If not, just remove the whole > respond_to block and it will attempt to render index.fbml.erb. > > Mike > > > On Jul 11, 2008, at 1:13 AM, ?? wrote: > > How should I set my controller for fbml? Can you give me an example? >> >> I just tried "format.fbml", and failed. Or should I do some configuration? >> >> 2008/7/11, David Clements <digidigo at gmail.com>: fbml is the format type >> for canvas requests. >> >> Dave >> >> >> >> On Thu, Jul 10, 2008 at 9:30 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >> I just followed http://apps.facebook.com/facebooker_tutorial/. >> And now I think the root cause is the controller which the tutorial >> doesn''t mention a lot. >> >> Now my controller action looks like: >> def add_facebook_application >> @users = User.find(:all) >> end >> It''s fine. >> >> I used to write my controller like: >> def add_facebook_application >> @users = User.find(:all) >> respond_to do |format| >> format.html # index.html.erb >> format.xml { render :xml => @users } >> end >> end >> This version causes the 406 error. >> >> So What kind of MIME type should I return for the FBML request? >> >> >> 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: >> >> Do you have a .fbml.erb template for your action? It looks like Rails >> doesn''t know how to respond to that request. >> >> Mike >> >> >> On Jul 10, 2008, at 12:22 AM, ?? wrote: >> >> Current configuration: >> api_key: 1cf93933582d5835bebe98d286158273 >> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >> canvas_page_name: favoritelink >> callback_url: http://skygroup.heroku.com:80 >> >> Facebook Error message: >> Errors while loading page from application >> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >> >> Hosting Logs: >> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >> Parameters: {"fb_sig_time"=>"1215663521.2908", >> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >> "fb_sig_locale"=>"en_US", "action"=>"index", >> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >> "fb_sig_request_method"=>"GET", "controller"=>"users", >> "fb_sig_expires"=>"0", >> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >> [http://skygroup.heroku.com/] >> >> >> >> ?08-7-10?David Clements <digidigo at gmail.com> ??? First thing to try is >> removing the slashes from the canvas_page_name.... >> >> If that doesn''t help can you send more details from your rails log? >> >> Dave >> >> >> On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >> Hi, everyone, >> I am the new one for the facebooker and just created my facebook >> application. >> I start my first application by following the facebooker_tutorial and >> use heroku as my host. >> My application works fine in "Iframe" mode, but when I turn to "FBML" >> mode, I recieved 406 error from my host. >> Does someone has any idea? I think maybe I do something wrong in my >> facebooker configuration. >> >> Here is my facebooker.yml configuration: >> api_key: xxxxxxxxxxxxxxxxxxx >> secret_key: xxxxxxxxxxxxxxxxxxxx >> canvas_page_name: /favoritelink/ >> callback_url: http://skygroup.heroku.com:80 >> >> >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> >> >> >> >> >> > -- > Mike Mangino > http://www.elevatedrails.com > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080711/dc4c4ad0/attachment-0001.html>
If you want to use "format.fbml", you could add, Mime::Type.register "text/fbml", :fbml to your environment.rb file (or at the top of your controller class file but then you''ll get warnings). Ask jeeves about it. Richard On Fri, 11 Jul 2008, ???? wrote:> How should I set my controller for fbml? Can you give me an example?I just tried "format.fbml", and failed. Or should I do some configuration? 2008/7/11, David Clements <digidigo at gmail.com>:> > fbml is the format type for canvas requests. > > Dave > > > On Thu, Jul 10, 2008 at 9:30 PM, ???? <xiuxiu.luo.xiao at gmail.com> wrote: > >> I just followed http://apps.facebook.com/facebooker_tutorial/. >> And now I think the root cause is the controller which the tutorial >> doesn''t mention a lot. >> >> Now my controller action looks like: >> def add_facebook_application @users = User.find(:all) >> end >> It''s fine. >> >> I used to write my controller like: >> def add_facebook_application @users = User.find(:all) >> respond_to do |format| format.html # index.html.erb >> format.xml { render :xml => @users } >> end >> end >> This version causes the 406 error. >> >> So What kind of MIME type should I return for the FBML request? >> >> >> 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: >> >> Do you have a .fbml.erb template for your action? It looks like Rails >>> doesn''t know how to respond to that request. >>> >>> Mike >>> >>> >>> On Jul 10, 2008, at 12:22 AM, ???? wrote: >>> >>> Current configuration: >>>> api_key: 1cf93933582d5835bebe98d286158273 >>>> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >>>> canvas_page_name: favoritelink >>>> callback_url: http://skygroup.heroku.com:80 >>>> >>>> Facebook Error message: >>>> Errors while loading page from application >>>> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >>>> >>>> Hosting Logs: >>>> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >>>> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >>>> Parameters: {"fb_sig_time"=>"1215663521.2908", >>>> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >>>> "fb_sig_locale"=>"en_US", "action"=>"index", >>>> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >>>> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >>>> "fb_sig_request_method"=>"GET", "controller"=>"users", >>>> "fb_sig_expires"=>"0", >>>> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >>>> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >>>> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >>>> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >>>> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >>>> [http://skygroup.heroku.com/] >>>> >>>> >>>> >>>> ??08-7-10??David Clements <digidigo at gmail.com> ?????? First thing to try is >>>> removing the slashes from the canvas_page_name.... >>>> >>>> If that doesn''t help can you send more details from your rails log? >>>> >>>> Dave >>>> >>>> >>>> On Wed, Jul 9, 2008 at 10:00 PM, ???? <xiuxiu.luo.xiao at gmail.com> wrote: >>>> Hi, everyone, >>>> I am the new one for the facebooker and just created my facebook >>>> application. >>>> I start my first application by following the facebooker_tutorial and >>>> use heroku as my host. >>>> My application works fine in "Iframe" mode, but when I turn to "FBML" >>>> mode, I recieved 406 error from my host. >>>> Does someone has any idea? I think maybe I do something wrong in my >>>> facebooker configuration. >>>> >>>> Here is my facebooker.yml configuration: >>>> api_key: xxxxxxxxxxxxxxxxxxx >>>> secret_key: xxxxxxxxxxxxxxxxxxxx >>>> canvas_page_name: /favoritelink/ >>>> callback_url: http://skygroup.heroku.com:80 >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Facebooker-talk mailing list >>>> Facebooker-talk at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/facebooker-talk >>>> >>> >>> -- >>> Mike Mangino >>> http://www.elevatedrails.com >>> >>> >>> >>> >> >
Thanks for your advice. My application got to work according to your advice. And after that, I found another solution to make it works perfect. 1add the MIME type to the config/initializers/mime_types.rb Mime::Type.register_alias ''text/html'', :fbml 2change the respond_to block to respond_to do |format| format.html # index.html.erb format.fbml # index.fbml.erb end 2008/7/11 Mike Mangino <mmangino at elevatedrails.com>:> Are you actually using the format.xml? If not, just remove the whole > respond_to block and it will attempt to render index.fbml.erb. > > Mike > > > On Jul 11, 2008, at 1:13 AM, ?? wrote: > > How should I set my controller for fbml? Can you give me an example? >> >> I just tried "format.fbml", and failed. Or should I do some configuration? >> >> 2008/7/11, David Clements <digidigo at gmail.com>: fbml is the format type >> for canvas requests. >> >> Dave >> >> >> >> On Thu, Jul 10, 2008 at 9:30 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >> I just followed http://apps.facebook.com/facebooker_tutorial/. >> And now I think the root cause is the controller which the tutorial >> doesn''t mention a lot. >> >> Now my controller action looks like: >> def add_facebook_application >> @users = User.find(:all) >> end >> It''s fine. >> >> I used to write my controller like: >> def add_facebook_application >> @users = User.find(:all) >> respond_to do |format| >> format.html # index.html.erb >> format.xml { render :xml => @users } >> end >> end >> This version causes the 406 error. >> >> So What kind of MIME type should I return for the FBML request? >> >> >> 2008/7/10 Mike Mangino <mmangino at elevatedrails.com>: >> >> Do you have a .fbml.erb template for your action? It looks like Rails >> doesn''t know how to respond to that request. >> >> Mike >> >> >> On Jul 10, 2008, at 12:22 AM, ?? wrote: >> >> Current configuration: >> api_key: 1cf93933582d5835bebe98d286158273 >> secret_key: 2863b13fc58f57cae527de45fd4b7f20 >> canvas_page_name: favoritelink >> callback_url: http://skygroup.heroku.com:80 >> >> Facebook Error message: >> Errors while loading page from application >> Received HTTP error code 406 while loading http://skygroup.heroku.com/ >> >> Hosting Logs: >> Processing UsersController#index (for 204.15.23.168 at 2008-07-09 >> 21:18:41) [GET] Session ID: 7f20696ddc5efd8ef3998392-830843210 >> Parameters: {"fb_sig_time"=>"1215663521.2908", >> "fb_sig"=>"ffa784e9d1c76353dd88a37625d89562", "_method"=>"GET", >> "fb_sig_locale"=>"en_US", "action"=>"index", >> "fb_sig_session_key"=>"7f20696ddc5efd8ef3998392-830843210", >> "fb_sig_position_fix"=>"1", "fb_sig_in_canvas"=>"1", >> "fb_sig_request_method"=>"GET", "controller"=>"users", >> "fb_sig_expires"=>"0", >> "fb_sig_friends"=>"2262404,4804216,5249680,9008910,13750643,506937136,520168433,522304594,528043834,529227427,538707016,540922141,542807705,543517145,550351017,555204379,561335842,563186606,566958300,580552312,581167055,581779377,587040751,590419111,590873221,597463133,598249007,598417675,600028743,622739483,630356681,644401706,651304761,654746992,658132952,661102891,665035038,678155312,679629309,686493571,695123717,696545870,702425899,705314598,712999475,723616403,725213313,728613392,737104108,762788417,784900135,795141561,817255113,819588350,831174826,868845223,1019763240,1034498395,1038216447,1042776567,1047188638,1068223901,1070105629,1095256539,1157552746,1207667867,1254027126,1266144372,1270883167,1277082451,1277868215,1281204041,1283784221,1283784227,1303114794", >> "fb_sig_added"=>"0", "fb_sig_api_key"=>"1cf93933582d5835bebe98d286158273", >> "fb_sig_profile_update_time"=>"1211120190", "fb_sig_user"=>"830843210"} >> User Load (0.001291) SELECT * FROM users Completed in 0.00914 (109 >> reqs/sec) | Rendering: 0.00006 (0%) | DB: 0.00129 (14%) | 406 Not Acceptable >> [http://skygroup.heroku.com/] >> >> >> >> ?08-7-10?David Clements <digidigo at gmail.com> ??? First thing to try is >> removing the slashes from the canvas_page_name.... >> >> If that doesn''t help can you send more details from your rails log? >> >> Dave >> >> >> On Wed, Jul 9, 2008 at 10:00 PM, ?? <xiuxiu.luo.xiao at gmail.com> wrote: >> Hi, everyone, >> I am the new one for the facebooker and just created my facebook >> application. >> I start my first application by following the facebooker_tutorial and >> use heroku as my host. >> My application works fine in "Iframe" mode, but when I turn to "FBML" >> mode, I recieved 406 error from my host. >> Does someone has any idea? I think maybe I do something wrong in my >> facebooker configuration. >> >> Here is my facebooker.yml configuration: >> api_key: xxxxxxxxxxxxxxxxxxx >> secret_key: xxxxxxxxxxxxxxxxxxxx >> canvas_page_name: /favoritelink/ >> callback_url: http://skygroup.heroku.com:80 >> >> >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >> >> -- >> Mike Mangino >> http://www.elevatedrails.com >> >> >> >> >> >> >> > -- > Mike Mangino > http://www.elevatedrails.com > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080712/8ae202d8/attachment.html>