ActiveResource Failed With Rails 2.2.1

When Rails try to generate <% form_for(@product) do |f| %> for an ActiveResource::Base Product, it's failed like that :

product_url failed to generate from {:action=>"show" ...

and with move to 2.1.2 and restart mongrel, it's work well.

Kind Regards

Can you include the whole error message please?

Processing ProductsController#new (for 127.0.0.1 at 2008-11-18 14:26:18) [GET]   e[4;36;1mSQL (0.2ms)e[0m e[0;1mSET NAMES 'latin1'e[0m   e[4;35;1mSQL (0.1ms)e[0m e[0mSET SQL_AUTO_IS_NULL=0e[0m   e[4;36;1mSQL (0.1ms)e[0m e[0;1mSET NAMES 'latin1'e[0m   e[4;35;1mSQL (0.1ms)e[0m e[0mSET SQL_AUTO_IS_NULL=0e[0m Rendering template within layouts/products Rendering products/new

ActionView::TemplateError (product_url failed to generate from {:action=>"show", :id=>#<Product:0x2093d58 @prefix_options={}, @attributes={}>, :controller=>"products"}, expected: {:action=>"show", :controller=>"products"}, diff: {:id=>#<Product: 0x2093d58 @prefix_options={}, @attributes={}>}) on line #3 of app/ views/products/new.html.erb: 1: <h1>New product</h1> 2: 3: <% form_for(@product) do |f| %> 4: <%= f.error_messages %> 5: 6: <p>

    /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ routing/route_set.rb:376:in `raise_named_route_error'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ routing/route_set.rb:340:in `generate'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ url_rewriter.rb:208:in `rewrite_path'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ url_rewriter.rb:187:in `rewrite_url'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ url_rewriter.rb:165:in `rewrite'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:626:in `url_for'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ helpers/url_helper.rb:85:in `send'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ helpers/url_helper.rb:85:in `url_for'     (eval):15:in `product_path'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ polymorphic_routes.rb:111:in `__send__'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ polymorphic_routes.rb:111:in `polymorphic_url'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ polymorphic_routes.rb:118:in `polymorphic_path'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ helpers/form_helper.rb:269:in `apply_form_for_options!'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ helpers/form_helper.rb:248:in `form_for'     app/views/products/new.html.erb:3     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ renderable.rb:37:in `send'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ renderable.rb:37:in `render'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ template.rb:73:in `render_template'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ base.rb:251:in `render'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ base.rb:361:in `_render_with_layout'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_view/ base.rb:249:in `render'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:1174:in `render_for_file'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:905:in `render_without_benchmark'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ benchmarking.rb:51:in `render'     /Library/Ruby/Gems/1.8/gems/activesupport-2.2.1/lib/active_support/ core_ext/benchmark.rb:8:in `realtime'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ benchmarking.rb:51:in `render'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:135:in `send'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:135:in `custom'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:164:in `call'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:164:in `respond'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:158:in `each'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:158:in `respond'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ mime_responds.rb:107:in `respond_to'     app/controllers/products_controller.rb:29:in `new'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:1253:in `send'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:1253:in `perform_action_without_filters'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ filters.rb:617:in `call_filters'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ filters.rb:610:in `perform_action_without_benchmark'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ benchmarking.rb:68:in `perform_action_without_rescue'     /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/benchmark.rb:293:in `measure'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ benchmarking.rb:68:in `perform_action_without_rescue'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ rescue.rb:136:in `perform_action_without_caching'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ caching/sql_cache.rb:13:in `perform_action'     /Library/Ruby/Gems/1.8/gems/activerecord-2.2.1/lib/active_record/ connection_adapters/abstract/query_cache.rb:34:in `cache'     /Library/Ruby/Gems/1.8/gems/activerecord-2.2.1/lib/active_record/ query_cache.rb:8:in `cache'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ caching/sql_cache.rb:12:in `perform_action'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:524:in `send'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:524:in `process_without_filters'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ filters.rb:606:in `process_without_session_management_support'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ session_management.rb:134:in `process'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ base.rb:392:in `process'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:183:in `handle_request'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:110:in `dispatch_unlocked'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:123:in `dispatch'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:122:in `synchronize'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:122:in `dispatch'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:132:in `dispatch_cgi'     /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/action_controller/ dispatcher.rb:39:in `dispatch'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb: 76:in `process'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb: 74:in `synchronize'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb: 74:in `process'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:282:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `each'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb: 212:in `run'     /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281     /usr/bin/mongrel_rails:19:in `load'     /usr/bin/mongrel_rails:19

Rendered /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/ action_controller/templates/rescues/_trace (37.4ms) Rendered /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/ action_controller/templates/rescues/_request_and_response (0.7ms) Rendering /Library/Ruby/Gems/1.8/gems/actionpack-2.2.1/lib/ action_controller/templates/rescues/layout.erb (internal_server_error)

Can you Open a ticket for this? We'll also need your routes file.

It looks like this is caused by you having map.resource :product instead of map.resources :products?

Ok #1455 ActiveResource Failed With Rails 2.2.1 - Ruby on Rails - rails