Best way to implement User model with Interests?

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?

On 3 April 2014 04:09, Cameron C. remove[email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs