Ruby on Rails Tuesday, March 22, 2016

On 22 March 2016 at 20:07, Johnny Stewart <lists@ruby-forum.com> wrote:
> Interesting, do you mean this sort of thing:
>
> http://guides.rubyonrails.org/association_basics.html
>
> would you do that like-
>
> has many through?

Possibly something like
User has_many albums

Album belongs_to user
Album has_many images

Image belongs_to album

If you want to be able to reference all the images belonging to a user
at once (whatever album they are in) then possibly also
User has_many images through albums

Colin

>
> I'll take a look at that..
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/425792824cf7a6f0f9197217e7a857d3%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtWBm9Z-K762TH8SAay51aSJHA%2BK5i4FrQHTUWG3YX%3Dxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment