Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3.1: Any tutorials for deeply nested models?

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.

like image 688
imjp Avatar asked Jul 29 '11 13:07

imjp


2 Answers

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

like image 88
Hishalv Avatar answered Nov 08 '22 10:11

Hishalv


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.

like image 44
iafonov Avatar answered Nov 08 '22 12:11

iafonov