Finance モジュールには次のモデルがあります。
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 %>
ルート.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 と、モジュールを使用したネストされたルートでどうすればよいですか?