Sorry for this nooby question.
Reading this here : guides.rugyonrails
It says that the belongs_to association is appropriate when each book can be assigned to exactly one author. But what is the best practice if a book can have several authors?
I need a table Books and a table Authors, where Books can have 1 to 10 authors.
Thanks !
has_many
is the answer for you. So in the Book modelhas_many :authors
and the Author modelbelongs_to :book
. You should read has_many association rubyonrails