Rails 3.1: Any tutorials for deeply nested models?

痞子三分冷 提交于 2019-12-21 17:34:51

问题


I'm looking for a working tutorial for Rails 3.1 that shows you step-by-step how to create a nested model that's 3 levels deep.

The "complex forms" screencasts on RailsCasts doesn't seem to be working, seeing that the code is 4+ years old.


回答1:


try looking at these tuts from railscasts(posted january last year)

http://railscasts.com/episodes/196-nested-model-form-part-1

and

http://railscasts.com/episodes/197-nested-model-form-part-2

I did initially have problems with deep nesting, but they all follow the same pattern, checkout the problems i faced with rails 3 below

Problems adding fields in nested form through jQuery form railscasts episode

How to limit nested form fields using jquery not working

hope this helps as deeply nested fields can be tricky at first




回答2:


I suggest you to try Rails guides/Rails API. There is no difference whether you have 1-level nesting or 10-level nesting the only thing you have to do is to understand the concepts behind the implementation if you'll do it yourself it would be much more effective than just copying source from article.



来源:https://stackoverflow.com/questions/6874057/rails-3-1-any-tutorials-for-deeply-nested-models

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!