我有一个看起来像这样的 Client 和 ProposalRequest 模型:
class Client < ActiveRecord::Base
has_many :proposal_requests
accepts_nested_attributes_for :proposal_requests, :allow_destroy => true
end
class ProposalRequest < ActiveRecord::Base
belongs_to :client
end
在我的路线文件中,我像往常一样包含了嵌套路线。
resources :clients do
resources :proposal_requests
end
到目前为止,这是我的表格:
-semantic_form_for [Client.new, ProposalRequest.new] do |f|
=f.inputs
=f.buttons
但在此之后,我因为这个错误而被卡住了。
No route matches {:controller=>"proposal_requests", :client_id=>#<Client id: nil, name: nil, title: nil, organization: nil, street_address: nil, city: nil, state: nil, zip: nil, phone: nil, email: nil, status: "interested", how_you_heard: nil, created_at: nil, updated_at: nil>}
谁能帮我解决这个错误?