Rails 3.1: Any tutorials for deeply nested models?
I'm looking for a w开发者_运维知识库orking 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.
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
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.
精彩评论