【问题标题】:Polymorphic associations and multilevel nested resources多态关联和多级嵌套资源
【发布时间】:2011-01-15 07:33:50
【问题描述】:

Railscast 154 之后,我已经与 cmets 和一些父资源建立了多态关联。例如

http://localhost:3000/articles/1/comments/1  
http://localhost:3000/pictures/1/comments/1  

这很好用,但我还需要为已经嵌套的资源设置 cmets,例如

http://localhost:3000/stories/1/chapters/1/comments/1  
http://localhost:3000/forums/1/topics/1/comments/1  

实现这一点的最佳方法是什么?

【问题讨论】:

  • @ShreyasSatish 什么答案?指向一个外部 URL 而不提示任何解释是一个答案。

标签: ruby-on-rails polymorphic-associations nested-resources


【解决方案1】:

这个Railscast 应该可以帮到你。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-24
    • 2011-10-07
    • 1970-01-01
    • 2018-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多