Ruby on Rails Thursday, April 3, 2014

On 3 April 2014 04:09, Cameron Craig <sentrathis96@gmail.com> wrote:
> I have a model with a belongs_to relationship to my Category model. I now
> need to implement a User model where a user can select each category they
> are interested in out of all categories available in the database. Since
> Category shares a relation with the another object I don't know if a HABTM
> would still work?

There is no problem with category has_many widgets and at the same
time category habtm users. I don't like habtm much, however, and
generally use has_many through so that I can see more clearly what is
going on. Either is ok for your use case however.

Colin

--
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%3D0gLtVTiWA%3DvOmKLbkuJEEKDZBPgXNmaL62SeNm5ZNsyiWBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment