In teaching Rails students I often arrive at the point where they've created two models and set up an association and are wondering how they can make that association visible in the views.
Now my question is, are there any overview articles / tutorials / blog posts for this,
which give an overview of the different ways to show Associations in the views. For example, I see several "Association Patterns", that are, a
I have tried searching for it. Also, neither Michael Hartl's Tutorial or the PragProgs "Agile Web Development with Rails" have something like that.
So, is there something out there and if not, do people think it would it be useful to create it?
For a more OO / less rails-way discussion of presenting object graphs in views, check out Avdi Grimm's discussion of what he calls the Exhibit pattern:
http://objectsonrails.com/#ID-2656c30c-080a-4a4e-a53e-4fbaad39c262
This has great examples and a good discussion of where and why it might be a good design decision not to follow the pure rails way, if your students are interested in going beyond the API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With