Error handling in Rails Controller for adding embedded Mongoid documents to Model
- by Dragonfly
I have a Item model that has embedded documents. Currently, the following comments_controller code will add a comment to the item successfully. However, if pushing the comment document onto the comments array on item fails, I will not know this.
#this does work, but i do not know if the push fails
def create
comment = Comment.new(:text…