Is anyone else getting this error in their routes, when running Facebooker from a plugin. ./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
Here is a brief followup to this post. I now know why this was occurring. It was non-obvious to me from looking at the comments in the source-code that you needed to append "map" to the front of the "facebook_resources" method. Everything worked great, once i rewrote me route to match this format: map.facebook_resources <facebook_controller> My suggestion would be to add "map." to the source comment to the routing.rb file inside facebooker/lib/facebooker/rails/ Best, Mark On Dec 10, 2007, at 12:35 PM, Heavy Sixer wrote:> Is anyone else getting this error in their routes, when running > Facebooker from a plugin. > > ./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 >
I''m hopefully going to make the facebook_resources method unnecessary tomorrow. I think we''ll be able to use regular resources shortly. Mike On Dec 10, 2007, at 3:23 PM, Heavy Sixer wrote:> Here is a brief followup to this post. I now know why this was > occurring. It was non-obvious to me from looking at the comments in > the source-code that you needed to append "map" to the front of the > "facebook_resources" method. > > Everything worked great, once i rewrote me route to match this format: > map.facebook_resources <facebook_controller> > > My suggestion would be to add "map." to the source comment to the > routing.rb file inside facebooker/lib/facebooker/rails/ > > Best, > Mark > > > > On Dec 10, 2007, at 12:35 PM, Heavy Sixer wrote: > >> Is anyone else getting this error in their routes, when running >> Facebooker from a plugin. >> >> ./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 >> > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Mike, That would be awesome! I am having a bear of a time right now trying to get my regular rails app working with a dedicated facebook controller. Mike, when you were designing the routes portion of the plugin did you intend for the user to set their app''s callback and canvas urls to the same name of the controller they specify for facebook actions? I am just a bit confused what goes where. Here is an example: I have a callback_url specified as: http://my_server.com/facebook_accounts I set my canvas page url http://apps.facebook.com/facebook_accounts Within my application I have this environment configuration: ENV[''FACEBOOKER_RELATIVE_URL_ROOT''] = ''facebook_accounts'' And these routes: map.facebook_resources :facebook_accounts This works out great for actions called by facebook like when a user adds or removes the app, everything works great. However, If I have a form on my site that I''d like the user to submit (outside of Facebook) the application starts to go screwy. Here is an example: I have a form, which posts to this action in my "facebook_accounts" controller <fb:editor action=";merge_accounts?canvas=true" labelwidth="100"> Facebook correctly posts to the right url, my controller specifies that it is to redirect when complete, I do so like this in the controller: redirect_to :action => ''index'' Yet, this produces a 404 error on the facebook side, because it is trying to resolve to: http://apps.facebook.com/facebook_accounts//facebook_accounts/index Do you have any idea what I am doing wrong with the way you''ve intended the rewrite rules to work? Any help is greatly appreciated. Thanks, Mark On Dec 10, 2007, at 6:32 PM, Mike Mangino wrote:> I''m hopefully going to make the facebook_resources method > unnecessary tomorrow. I think we''ll be able to use regular > resources shortly. > > Mike > > On Dec 10, 2007, at 3:23 PM, Heavy Sixer wrote: > >> Here is a brief followup to this post. I now know why this was >> occurring. It was non-obvious to me from looking at the comments in >> the source-code that you needed to append "map" to the front of the >> "facebook_resources" method. >> >> Everything worked great, once i rewrote me route to match this >> format: >> map.facebook_resources <facebook_controller> >> >> My suggestion would be to add "map." to the source comment to the >> routing.rb file inside facebooker/lib/facebooker/rails/ >> >> Best, >> Mark >> >> >> >> On Dec 10, 2007, at 12:35 PM, Heavy Sixer wrote: >> >>> Is anyone else getting this error in their routes, when running >>> Facebooker from a plugin. >>> >>> ./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 >>> >> >> _______________________________________________ >> 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/20071210/10a2f649/attachment-0001.html
One more followup, the Error console on Facebook say: no route found to match "facebook_accounts/index" with {:method=>:post} but this should be handled by the dynamically created routes in the map.facebook_resouces command correct? On Dec 10, 2007, at 9:59 PM, Heavy Sixer wrote:> Mike, > That would be awesome! > I am having a bear of a time right now trying to get my regular > rails app working with a dedicated facebook controller. > > Mike, when you were designing the routes portion of the plugin did > you intend for the user to set their app''s callback and canvas > urls to the same name of the controller they specify for facebook > actions? > > I am just a bit confused what goes where. Here is an example: > I have a callback_url specified as: > http://my_server.com/facebook_accounts > > I set my canvas page url > http://apps.facebook.com/facebook_accounts > > Within my application I have this environment configuration: > ENV[''FACEBOOKER_RELATIVE_URL_ROOT''] = ''facebook_accounts'' > > And these routes: > map.facebook_resources :facebook_accounts > > This works out great for actions called by facebook like when a > user adds or removes the app, everything works great. However, > If I have a form on my site that I''d like the user to submit > (outside of Facebook) the application starts to go screwy. Here is > an example: > I have a form, which posts to this action in my "facebook_accounts" > controller > <fb:editor action=";merge_accounts?canvas=true" labelwidth="100"> > > Facebook correctly posts to the right url, my controller specifies > that it is to redirect when complete, I do so like this in the > controller: > redirect_to :action => ''index'' > > Yet, this produces a 404 error on the facebook side, because it is > trying to resolve to: > http://apps.facebook.com/facebook_accounts//facebook_accounts/index > > Do you have any idea what I am doing wrong with the way you''ve > intended the rewrite rules to work? > > Any help is greatly appreciated. > > Thanks, > Mark > > On Dec 10, 2007, at 6:32 PM, Mike Mangino wrote: > >> I''m hopefully going to make the facebook_resources method >> unnecessary tomorrow. I think we''ll be able to use regular >> resources shortly. >> >> Mike >> >> On Dec 10, 2007, at 3:23 PM, Heavy Sixer wrote: >> >>> Here is a brief followup to this post. I now know why this was >>> occurring. It was non-obvious to me from looking at the comments in >>> the source-code that you needed to append "map" to the front of the >>> "facebook_resources" method. >>> >>> Everything worked great, once i rewrote me route to match this >>> format: >>> map.facebook_resources <facebook_controller> >>> >>> My suggestion would be to add "map." to the source comment to the >>> routing.rb file inside facebooker/lib/facebooker/rails/ >>> >>> Best, >>> Mark >>> >>> >>> >>> On Dec 10, 2007, at 12:35 PM, Heavy Sixer wrote: >>> >>>> Is anyone else getting this error in their routes, when running >>>> Facebooker from a plugin. >>>> >>>> ./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 >>>> >>> >>> _______________________________________________ >>> 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/20071210/9537f47b/attachment.html