which relationship to use?

Hi all.

  I've the following scenario:

users id

cars id name

  One user has many cars, but I need to always edit cars table (add more models, edit actual models, etc.). So, I'm think about use another table:

cars_users id_user id_car

  This means an HABTM relationship, right? Is this the rigth approach to my problem? One user doesn't belongs to a car (in my point of view).

  What should I do?

  Best regards and sorry my poor English,

hey Davi.

You might want to look into "has_many :through =>" and use a join
table for the relationship.

best. mike

users id

cars id name

        One user has many cars, but I need to always edit cars table (add more models, edit actual models, etc.). So, I'm think about use another table:

cars_users id_user id_car

        This means an HABTM relationship, right? Is this the rigth approach to my problem? One user doesn't belongs to a car (in my point of view).

Yes, your secong version would be a habtm. But what for? If one user can have several cars, but a car only belongs to a single user there is no need for that. (This has nothing to do with editing)

The simple question: Can a car have several users? If yes, you'll need habtm, otherwise it's not necessary.