2
簽名我有一個Mongoid文檔:的form_for爲Mongoid ::文檔子
class Index
include Mongoid::Document
end
和兩個子類 '指數' 爲:
class PercentileRankIndex < Index
end
class SocialStockIndex < Index
end
我想創建一個的form_for說「PercentileRankIndex 」,這是我現有的代碼簽名:
<%= form_for ([@index, @question]) do |f| %>
都到路線:'percentile_rank_index_questions_path'
爲@index是Percen實例tileRankIndex。
但是它存在正確的路線是:'index_questions'
應該如何我的form_for簽名的樣子,以便在指數實例與適當的_type屬性產生的?