I have this structure in my app:
USER has_one :publicprofile, :privateprofile
PUBLICPROFILE has many :emails, :phonenumbers
PRIVATEPROFILE has many :adresses, :creditcards
I would like to know how to go about having a profile page for the user where I can update his nested resources (and do it in a RESTful way). I couldn't find any docs/examples on the subject (because of that confusing has_one relation).
I believe any nesting deeper than 1-level is generally frowned upon, and can normally be avoided. Jamis Buck blogged about it a while back.
The PeepCode REST for Rails 2 screencast is quite good too, but it doesn't go extensively into nesting, just resources in general.
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