Kamal Fariz
2007-Dec-05 15:18 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
With the new fb_sig_request_method provided by Facebook, I''ve patched shanev''s pseudo-resource routes to generate restful routes, minus some exceptions. The announcement: http://www.facebook.com/developers/message.php#msg_126 Patch is submitted here: http://rubyforge.org/tracker/index.php?func=detail&aid=16105&group_id=4187&atid=16132 Blog entry about it: http://blog.ror.com.my/2007/12/05/fb-sig-request-method-and-rails-differentiate-get-and-post/ Regards, Kamal
Heavy Sixer
2007-Dec-05 15:38 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
Very Interesting. I was not able to get the facebook_resources :model_name to work at all in my app. When i try and include it in my config/routes.rb file I get: ./script/../config/../config/routes.rb:67: undefined method `facebook_resources'' for main:Object (NoMethodError) from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/routing.rb:1139:in `draw'' from ./script/../config/../config/routes.rb:1 from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ lib/active_support/dependencies.rb:488:in `load'' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ lib/active_support/dependencies.rb:488:in `load'' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ lib/active_support/dependencies.rb:342:in `new_constants_in'' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ lib/active_support/dependencies.rb:488:in `load'' from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/routing.rb:1165:in `load_routes!'' from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/routing.rb:1157:in `reload'' ... 31 levels... from /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/ commands/server.rb:39 from /opt/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `gem_original_require'' from /opt/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:27:in `require'' from script/server:3 Yet the rest of the plugin works just fine. Did you have to do anything special to get it to work? I am on rails 1.2.3 btw. Later, Mark On Dec 5, 2007, at 9:18 AM, Kamal Fariz wrote:> With the new fb_sig_request_method provided by Facebook, I''ve patched > shanev''s pseudo-resource routes to generate restful routes, minus some > exceptions. > > The announcement: http://www.facebook.com/developers/ > message.php#msg_126 > > Patch is submitted here: http://rubyforge.org/tracker/index.php? > func=detail&aid=16105&group_id=4187&atid=16132 > > Blog entry about it: http://blog.ror.com.my/2007/12/05/fb-sig- > request-method-and-rails-differentiate-get-and-post/ > > > > Regards, > Kamal > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Chad Fowler
2007-Dec-05 16:34 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
On 12/5/07, Kamal Fariz <kamal at ror.com.my> wrote:> > With the new fb_sig_request_method provided by Facebook, I''ve patched > shanev''s pseudo-resource routes to generate restful routes, minus some > exceptions. > > The announcement: http://www.facebook.com/developers/message.php#msg_126 > > Patch is submitted here: > http://rubyforge.org/tracker/index.php?func=detail&aid=16105&group_id=4187&atid=16132 > > Blog entry about it: > http://blog.ror.com.my/2007/12/05/fb-sig-request-method-and-rails-differentiate-get-and-post/ > >Hi Kamal. This looks really cool! I haven''t been too active on the project in the past couple of months, because my Facebook development has cooled down for a while with other priorities. But I like the way this looks. I''d like to leave it to others who are more actively working with Facebooker to decide on whether to apply. One thing I would like, though, is if you could create some tests for this. One of my goals with Facebooker was for it to remain thoroughly covered by automated tests. I''d prefer not to accept any patches that aren''t well tested. Thanks! Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20071205/84a6eebd/attachment.html
Mike Mangino
2007-Dec-05 18:28 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
I would expect that with this change we won''t need the facebook_resource at all. We should be able to monkeypatch rails to use the fb_sig_request_method and fall back to the main method if that doesn''t exist. I would be much happier with a patch that does this. My goal is to make Facebook development work exactly like non-facebook development. Mike On Dec 5, 2007, at 10:34 AM, Chad Fowler wrote:> > > On 12/5/07, Kamal Fariz <kamal at ror.com.my> wrote: With the new > fb_sig_request_method provided by Facebook, I''ve patched > shanev''s pseudo-resource routes to generate restful routes, minus some > exceptions. > > The announcement: http://www.facebook.com/developers/message.php#msg_126 > > Patch is submitted here: http://rubyforge.org/tracker/index.php?func=detail&aid=16105&group_id=4187&atid=16132 > > Blog entry about it: http://blog.ror.com.my/2007/12/05/fb-sig-request-method-and-rails-differentiate-get-and-post/ > > > Hi Kamal. This looks really cool! > > I haven''t been too active on the project in the past couple of > months, because my Facebook development has cooled down for a while > with other priorities. But I like the way this looks. I''d like to > leave it to others who are more actively working with Facebooker to > decide on whether to apply. One thing I would like, though, is if > you could create some tests for this. One of my goals with > Facebooker was for it to remain thoroughly covered by automated > tests. I''d prefer not to accept any patches that aren''t well tested. > > Thanks! > Chad > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Shane Vitarana
2007-Dec-05 22:43 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
Mark- Are you running init.rb which hooks the facebook routing mapper extensions into routes? It looks like that is your problem. What I do is put facebooker vendor/plugins. This way, Rails thinks its a plugin and runs init.rb. Shane On 12/5/07, Heavy Sixer <heavysixer at gmail.com> wrote:> Very Interesting. > I was not able to get the facebook_resources :model_name to work at > all in my app. When i try and include it in my config/routes.rb file > I get: > > ./script/../config/../config/routes.rb:67: undefined method > `facebook_resources'' for main:Object (NoMethodError) > from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/routing.rb:1139:in `draw'' > from ./script/../config/../config/routes.rb:1 > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ > lib/active_support/dependencies.rb:488:in `load'' > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ > lib/active_support/dependencies.rb:488:in `load'' > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ > lib/active_support/dependencies.rb:342:in `new_constants_in'' > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/ > lib/active_support/dependencies.rb:488:in `load'' > from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/routing.rb:1165:in `load_routes!'' > from /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ > action_controller/routing.rb:1157:in `reload'' > ... 31 levels... > from /opt/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/ > commands/server.rb:39 > from /opt/local/lib/ruby/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `gem_original_require'' > from /opt/local/lib/ruby/site_ruby/1.8/rubygems/ > custom_require.rb:27:in `require'' > from script/server:3 > > > Yet the rest of the plugin works just fine. Did you have to do > anything special to get it to work? I am on rails 1.2.3 btw. > Later, > Mark > On Dec 5, 2007, at 9:18 AM, Kamal Fariz wrote: > > > With the new fb_sig_request_method provided by Facebook, I''ve patched > > shanev''s pseudo-resource routes to generate restful routes, minus some > > exceptions. > > > > The announcement: http://www.facebook.com/developers/ > > message.php#msg_126 > > > > Patch is submitted here: http://rubyforge.org/tracker/index.php? > > func=detail&aid=16105&group_id=4187&atid=16132 > > > > Blog entry about it: http://blog.ror.com.my/2007/12/05/fb-sig- > > request-method-and-rails-differentiate-get-and-post/ > > > > > > > > Regards, > > Kamal > > > > _______________________________________________ > > 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 >-- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com
Shane Vitarana
2007-Dec-05 22:51 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
> I would be much happier with a patch that does this. My goal is to > make Facebook development work exactly like non-facebook development. >It is definitely a cool idea to make Facebook development work exactly like vanilla restful Rails, but think about the case where you are adding Facebook support to an existing app. If you patch resource routing to be dependent on fb_sig_request or change the resource mapper, then routes will break for the non-Facebook portion of the app. This also applies for redirect_to. Shane -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com
Mike Mangino
2007-Dec-05 23:35 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
We do this already in a bunch of places, we just need to fallback. If fb_sig_request_method isn''t there, we fall back to the old handling. This is what we do for redirect_to, if the fb_sig_in_canvas parameter is there, we use an fb:redirect. Otherwise, we issue a real redirect. Mike On Dec 5, 2007, at 4:51 PM, Shane Vitarana wrote:>> I would be much happier with a patch that does this. My goal is to >> make Facebook development work exactly like non-facebook development. >> > > It is definitely a cool idea to make Facebook development work exactly > like vanilla restful Rails, but think about the case where you are > adding Facebook support to an existing app. If you patch resource > routing to be dependent on fb_sig_request or change the resource > mapper, then routes will break for the non-Facebook portion of the > app. > > This also applies for redirect_to. > > Shane > -- > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com-- Mike Mangino http://www.elevatedrails.com
Shane Vitarana
2007-Dec-06 00:03 UTC
[Facebooker-talk] Better RESTful routes with fb_sig_request_method
I do recall redirect_to having a fallback. So doing the same for routes would be perfect. On 12/5/07, Mike Mangino <mmangino at elevatedrails.com> wrote:> We do this already in a bunch of places, we just need to fallback. If > fb_sig_request_method isn''t there, we fall back to the old handling. > > This is what we do for redirect_to, if the fb_sig_in_canvas parameter > is there, we use an fb:redirect. Otherwise, we issue a real redirect. > > Mike > > On Dec 5, 2007, at 4:51 PM, Shane Vitarana wrote: > > >> I would be much happier with a patch that does this. My goal is to > >> make Facebook development work exactly like non-facebook development. > >> > > > > It is definitely a cool idea to make Facebook development work exactly > > like vanilla restful Rails, but think about the case where you are > > adding Facebook support to an existing app. If you patch resource > > routing to be dependent on fb_sig_request or change the resource > > mapper, then routes will break for the non-Facebook portion of the > > app. > > > > This also applies for redirect_to. > > > > Shane > > -- > > http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com