Pretty sure I already wrote the alias on this but still haven''t found a solution to links for will paginate not being interpreted properly on Facebook. When I mouse over a paginate link I''m seeing a path of: http://app/path/index.fbml?_method=GET&fb_sig=742f6e3b4c1f21429de8abf3ebe413d7&fb_sig_added=1&fb_sig_api_key=aac4a507072a2272861620d4465805f9&fb_sig_expires=0&fb_sig_friends=43301100%2C48503782%2C53504644%2C58404877%2C501935451%2C532590319%2C535968041%2C567441833%2C612695156%2C669749967%2C669844464%2C670068651%2C680080756%2C682941909%2C690221893%2C719442065%2C726784712%2C733871420%2C754176811%2C800578706%2C867800017%2C1015280498%2C1035955620%2C1039496249%2C1081166150%2C1139158064%2C1143009096%2C1148066130%2C1159839159%2C1170759151%2C1193132280%2C1319695075%2C1323279749%2C1340134522%2C1346645414%2C1358658083%2C1396590279%2C1442130784%2C1461120042&fb_sig_in_canvas=1&fb_sig_in_new_facebook=1&fb_sig_locale=en_US&fb_sig_position_fix=1&fb_sig_profile_update_time=1215114821&fb_sig_request_method=GET&fb_sig_session_key=e1975924bb2d3d4ae8ec183e-1170442486&fb_sig_time=1219434912.1452&fb_sig_user=1170442486&page=3 as opposed to what I should see of http://app/path?page=3 Pagination works as expected if I input the path as above. Would appreciate if anyone has any ideas on this. Thanks --ken -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080822/0c82a21b/attachment.html>
Can you give a little more information about your code? We''re using will paginate out of the box on Facebook. Mike On Aug 22, 2008, at 3:58 PM, Ken Schroeder wrote:> Pretty sure I already wrote the alias on this but still haven''t > found a solution to links for will paginate not being interpreted > properly on Facebook. When I mouse over a paginate link I''m seeing > a path of: > http://app/path/index.fbml?_method=GET&fb_sig=742f6e3b4c1f21429de8abf3ebe413d7&fb_sig_added=1&fb_sig_api_key=aac4a507072a2272861620d4465805f9&fb_sig_expires=0&fb_sig_friends=43301100%2C48503782%2C53504644%2C58404877%2C501935451%2C532590319%2C535968041%2C567441833%2C612695156%2C669749967%2C669844464%2C670068651%2C680080756%2C682941909%2C690221893%2C719442065%2C726784712%2C733871420%2C754176811%2C800578706%2C867800017%2C1015280498%2C1035955620%2C1039496249%2C1081166150%2C1139158064%2C1143009096%2C1148066130%2C1159839159%2C1170759151%2C1193132280%2C1319695075%2C1323279749%2C1340134522%2C1346645414%2C1358658083%2C1396590279%2C1442130784%2C1461120042&fb_sig_in_canvas=1&fb_sig_in_new_facebook=1&fb_sig_locale=en_US&fb_sig_position_fix=1&fb_sig_profile_update_time=1215114821&fb_sig_request_method=GET&fb_sig_session_key=e1975924bb2d3d4ae8ec183e-1170442486&fb_sig_time=1219434912.1452&fb_sig_user=1170442486&page=3 > > as opposed to what I should see of > http://app/path?page=3 > > Pagination works as expected if I input the path as above. Would > appreciate if anyone has any ideas on this. Thanks --ken > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Yeah, I''ve seen this. What''s going on is that will_paginate thinks that it should send all the facebook params on to the next request. So you are making a request to facebook with tons of its own params. I fixed it with a little hack: First I have a hash in application.rb with the params that facebook sends all set to nil: @nil_facebook_params = {"_method" => nil, "fb_sig" => nil, "fb_sig_added" => nil, "fb_sig_expires" => nil, "fb_sig_api_key" => nil, "fb_sig_friends" => nil, "fb_sig_in_canvas" => nil, "fb_sig_locale" => nil, "fb_sig_position_fix" => nil, "fb_sig_profile_update_time" => nil, "fb_sig_request_method" => nil, "fb_sig_session_key" => nil, "fb_sig_time" => nil, "fb_sig_user" => nil, "format" => nil} Then I pass those params through to will_paginate whenever I use it: <%= will_paginate @users, {:params => @nil_facebook_params} %> I can imagine that there are much better ways to do this but it has worked perfectly for me and I like how I don''t have to alter the will_paginate plugin. All the best, Joseph http://inigral.com On Fri, Aug 22, 2008 at 12:58 PM, Ken Schroeder <schroeder.ken at gmail.com> wrote:> Pretty sure I already wrote the alias on this but still haven''t found a > solution to links for will paginate not being interpreted properly on > Facebook. When I mouse over a paginate link I''m seeing a path of: > http://app/path/index.fbml?_method=GET&fb_sig=742f6e3b4c1f21429de8abf3ebe413d7&fb_sig_added=1&fb_sig_api_key=aac4a507072a2272861620d4465805f9&fb_sig_expires=0&fb_sig_friends=43301100%2C48503782%2C53504644%2C58404877%2C501935451%2C532590319%2C535968041%2C567441833%2C612695156%2C669749967%2C669844464%2C670068651%2C680080756%2C682941909%2C690221893%2C719442065%2C726784712%2C733871420%2C754176811%2C800578706%2C867800017%2C1015280498%2C1035955620%2C1039496249%2C1081166150%2C1139158064%2C1143009096%2C1148066130%2C1159839159%2C1170759151%2C1193132280%2C1319695075%2C1323279749%2C1340134522%2C1346645414%2C1358658083%2C1396590279%2C1442130784%2C1461120042&fb_sig_in_canvas=1&fb_sig_in_new_facebook=1&fb_sig_locale=en_US&fb_sig_position_fix=1&fb_sig_profile_update_time=1215114821&fb_sig_request_method=GET&fb_sig_session_key=e1975924bb2d3d4ae8ec183e-1170442486&fb_sig_time=1219434912.1452&fb_sig_user=1170442486&page=3 > > as opposed to what I should see of > http://app/path?page=3 > > Pagination works as expected if I input the path as above. Would appreciate > if anyone has any ideas on this. Thanks --ken > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >
I''ve pretty much have done same as you have outlined in your book. I''m using same controller and view code via non-facebook interface and it works fine. I''ve used it in the past and know it''s simple implementation that''s why I''m baffeled by the problem. Below is what I''ve implemented. Controller index method has this: @groups = Group.paginate(:all, :order => "name asc", :per_page => 20, :page => (params[:page]||1)) view index.fbml.erb has <%= will_paginate @groups, :param_name => :page %> On Fri, Aug 22, 2008 at 4:20 PM, Mike Mangino <mmangino at elevatedrails.com>wrote:> Can you give a little more information about your code? We''re using will > paginate out of the box on Facebook. > > Mike > > > On Aug 22, 2008, at 3:58 PM, Ken Schroeder wrote: > > Pretty sure I already wrote the alias on this but still haven''t found a >> solution to links for will paginate not being interpreted properly on >> Facebook. When I mouse over a paginate link I''m seeing a path of: >> >> http://app/path/index.fbml?_method=GET&fb_sig=742f6e3b4c1f21429de8abf3ebe413d7&fb_sig_added=1&fb_sig_api_key=aac4a507072a2272861620d4465805f9&fb_sig_expires=0&fb_sig_friends=43301100%2C48503782%2C53504644%2C58404877%2C501935451%2C532590319%2C535968041%2C567441833%2C612695156%2C669749967%2C669844464%2C670068651%2C680080756%2C682941909%2C690221893%2C719442065%2C726784712%2C733871420%2C754176811%2C800578706%2C867800017%2C1015280498%2C1035955620%2C1039496249%2C1081166150%2C1139158064%2C1143009096%2C1148066130%2C1159839159%2C1170759151%2C1193132280%2C1319695075%2C1323279749%2C1340134522%2C1346645414%2C1358658083%2C1396590279%2C1442130784%2C1461120042&fb_sig_in_canvas=1&fb_sig_in_new_facebook=1&fb_sig_locale=en_US&fb_sig_position_fix=1&fb_sig_profile_update_time=1215114821&fb_sig_request_method=GET&fb_sig_session_key=e1975924bb2d3d4ae8ec183e-1170442486&fb_sig_time=1219434912.1452&fb_sig_user=1170442486&page=3 >> >> as opposed to what I should see of >> http://app/path?page=3 >> >> Pagination works as expected if I input the path as above. Would >> appreciate if anyone has any ideas on this. Thanks --ken >> _______________________________________________ >> 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/20080822/7353f6ad/attachment.html>
Ahhhh finally that did the trick. I had tried similar techniques to no avail but in the view directly. Doing as you suggested works like a champ. Would be interesting to understand why it behaves that way as opposed to straight out the box like Mike and many others have implented. I''m not sure where to begin about trying to debug that though. On Fri, Aug 22, 2008 at 4:50 PM, Joseph Sofaer <joseph.sofaer at gmail.com>wrote:> Yeah, > I''ve seen this. What''s going on is that will_paginate thinks that it > should send all the facebook params on to the next request. So you are > making a request to facebook with tons of its own params. > I fixed it with a little hack: > > First I have a hash in application.rb with the params that facebook > sends all set to nil: > > @nil_facebook_params = {"_method" => nil, "fb_sig" => nil, > "fb_sig_added" => nil, "fb_sig_expires" => nil, "fb_sig_api_key" => > nil, "fb_sig_friends" => nil, "fb_sig_in_canvas" => nil, > "fb_sig_locale" => nil, "fb_sig_position_fix" => nil, > "fb_sig_profile_update_time" => nil, "fb_sig_request_method" => nil, > "fb_sig_session_key" => nil, "fb_sig_time" => nil, "fb_sig_user" => > nil, "format" => nil} > > Then I pass those params through to will_paginate whenever I use it: > > <%= will_paginate @users, {:params => @nil_facebook_params} %> > > I can imagine that there are much better ways to do this but it has > worked perfectly for me and I like how I don''t have to alter the > will_paginate plugin. > > All the best, > Joseph > http://inigral.com > > > On Fri, Aug 22, 2008 at 12:58 PM, Ken Schroeder <schroeder.ken at gmail.com> > wrote: > > Pretty sure I already wrote the alias on this but still haven''t found a > > solution to links for will paginate not being interpreted properly on > > Facebook. When I mouse over a paginate link I''m seeing a path of: > > > http://app/path/index.fbml?_method=GET&fb_sig=742f6e3b4c1f21429de8abf3ebe413d7&fb_sig_added=1&fb_sig_api_key=aac4a507072a2272861620d4465805f9&fb_sig_expires=0&fb_sig_friends=43301100%2C48503782%2C53504644%2C58404877%2C501935451%2C532590319%2C535968041%2C567441833%2C612695156%2C669749967%2C669844464%2C670068651%2C680080756%2C682941909%2C690221893%2C719442065%2C726784712%2C733871420%2C754176811%2C800578706%2C867800017%2C1015280498%2C1035955620%2C1039496249%2C1081166150%2C1139158064%2C1143009096%2C1148066130%2C1159839159%2C1170759151%2C1193132280%2C1319695075%2C1323279749%2C1340134522%2C1346645414%2C1358658083%2C1396590279%2C1442130784%2C1461120042&fb_sig_in_canvas=1&fb_sig_in_new_facebook=1&fb_sig_locale=en_US&fb_sig_position_fix=1&fb_sig_profile_update_time=1215114821&fb_sig_request_method=GET&fb_sig_session_key=e1975924bb2d3d4ae8ec183e-1170442486&fb_sig_time=1219434912.1452&fb_sig_user=1170442486&page=3 > > > > as opposed to what I should see of > > http://app/path?page=3 > > > > Pagination works as expected if I input the path as above. Would > appreciate > > if anyone has any ideas on this. Thanks --ken > > > > _______________________________________________ > > 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/20080822/3e098831/attachment.html>