On Tue, 26 Jul 2011 09:11:53 -0700 (PDT), Frederick Cheung wrote:
On Jul 26, 5:06 pm, Rick & Nellie Flower <[email protected]> wrote:
> Sounds like you want either validates_with, which enables you to
> package up  a set of validations into something reusable or
> validates_associated, which would tell your user that when it
> validates itself it should also validate the associated address
> object.

Ok.. I'll check into that.. However, I'm still wondering if I can
have nested objects like I mentioned above -- e.g. a User object
containing an Address object and when it's time to write to the
database, both a User object is written but the associated Address
object is also written with some sort of foreign key between the two?

Well contain isn't how I would describe it, but objects that have
associations with other objects happens all the time.
Checkout the active record associations guide (
http://guides.rubyonrails.org/association_basics.html )

Thanks!  I'll check it out!

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to