When I use the method above, I get the following error:
Showing projects/show.html.builder where line #9 Adding records to a has_many collection does not work on initialization raised:
No route matches {:action=>"/projects/1"}
Extracted source (around line #9 Adding records to a has_many collection does not work on initialization):
6: end
7: end
8:
9: xml << form(:project)
The backtrace is as follows:
vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:368:in `generate'
vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:131:in `rewrite_path'
vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:110:in `rewrite_url'
vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:88:in `rewrite'
vendor/rails/actionpack/lib/action_controller/base.rb:621:in `url_for'
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:71:in `send'
vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb:71:in `url_for'
vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb:420:in `html_options_for_form'
vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:28:in `returning'
vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb:418:in `html_options_for_form'
vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb:37:in `form_tag'
vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb:84:in `form'
app/views/projects/show.html.builder:9:in `_run_builder_47app47views47projects47show46html46builder'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/home/armin/lib/gems/gems/mongrel-1.1.4/bin/mongrel_rails:281
The content of app/views/projects/show.html.builder is:
content_for :title do
if @project.id.nil?
'New Project'
else
"Project: #{@project.name}"
end
end
xml << form(:project)
The content of config/routes.rb is:
ActionController::Routing::Routes.draw do |map|
map.resources :projects
end
This seems to be a bug, because it has worked with 2.0.2 but it is not working with branch "master".
Thanks in advance,
Armin
P.S.: How can I help to analyze this further?