mercredi 13 mai 2015

Has_and_belong_to_many relation with the same model (rails)

I am trying to implement a has_and_belong_to_many relation with the same model like a user can follow many other users. I have tried to look for it on the INTERNET but I was not able to understand. Please tell me how to implement a self has_and_belong_to_many relation

The other thing is I have multiple fields of the same model in that model how would I give it another name.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire