1
我有一對夫婦的資源,一個grant_application的,並且其與一個HAS_ONERails的嵌套資源問題
class GrantApplication < ActiveRecord::Base
has_one :household, :dependent => :destroy
end
class Household < ActiveRecord::Base
belongs_to :grant_application
end
..和我也用下面的路由相關家庭..
map.resources :grant_applications do |grant|
grant.resource :household
end
但是,試圖創建/ grant_applications/1 /戶/形式新
使用時,我有真正的問題
<% form_for([:grant_application, @household]) do |f| %>
返回一個錯誤:
undefined method 'grant_households_path' for #<ActionView::Base:0x23eda44>
任何想法?