我在财务模块后续机型:的form_for与模块和命名空间
class Finance::BillRec < ActiveRecord::Base
...
has_many :bill_rec_offs, :dependent => :destroy
...
end
class Finance::BillRecOff < ActiveRecord::Base
...
belongs_to :bill_rec
...
end
我对我的form_for这样做:
<%= form_for([@bill_rec, @bill_rec_off]) do |f| %>
...
<% end %>
的routes.rb
namespace :finance do
resources :bill_recs do
resources :bill_rec_offs
end
end
并且错误:
undefined method `finance_bill_rec_finance_bill_rec_offs_path' for #<#<Class:0x000000070757e0>:0x0000000708bec8>
但是,路线finance_bill_rec_bill_rec_off_path(@bill_rec_off)运作良好。
我怎样才能做一个form_for命名空间和嵌套路线与模块?
看起来你张贴在谷歌组同样的问题。在这里添加一个链接,如果在那里回答,可以通知这里的人。 – JohnMerlino 2012-07-29 22:35:20
http://www.ruby-forum.com/topic/4404430 – 2012-07-30 18:11:37