I have a Book resource that belongs both to a User and to an Isbn.
What is the recommended way of building a new Book record in this type
class Book < ActiveRecord::Base
Currently I’m doing the following:
@isbn = Isbn.find(…)
book = @isbn.books.build(…)
book.user_id = @user.id
Is this the way it’s supposed to be done? I know that it’s preferred
to interact with dependent resources through their associations. So
adding the user_id manually seems a bit clunky to me. But I’m not
sure how else to do it!
Thanks in advance.