Finding errors from Rails collection<< association assignment

Viewed 39

In the event that collection<< for a has_many association on Rails fails, how to find the errors?

For example:

@author.books << @book1

If this was to fail, how to catch the errors and return to user?

Thanks

0 Answers
Related