2
我有一个多态模型评论,可以与许多类型的评论相关。 在我击溃,比如我有:用has_many构建一个多态模型控制器路径
map.resources :newsitems do |news|
news.resources :comments
end
一切工作正常,唯一的问题就是生成的路径。 我在我的意见/控制器@commentable项目,我从before_filter检索。
[@commentable,@comment]的链接可以很好地工作,就像表单,展示或销毁一样。 但链接到新的和编辑是混乱... comments_path(@commentable,@comment)不起作用,例如。
我怎么能在我的意见中建立这个动态路径?
尤其是edit_和new_路径