Dylan Pinn


15,810 Experience
151 Lessons Completed
1 Question Solved


Try adding `validates :authors, presence: true` to the Book model.
Hey your `create` action shouldn't need to loop over the `book_params` to create params.

I quickly created a sample app that shows how I use `cocoon` with many-to-many relationships.

It is at https://github.com/dylanpinn/rails-bookstore. Let me know how you go.
logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.