Nested strong parameters in rails - AssociationTypeMismatch MYMODEL expected, got ActionController::Parameters()
I'm rendering a model and it's children Books in JSON like so: {"id":2,"complete":false,"private":false, "books" [{ "id":2,"name":"Some Book"},..... I then come to update this model by passing the same JSON back to my controller and I get the following error: ActiveRecord::AssociationTypeMismatch (Book (#2245089560) expected, got ActionController::Parameters(#2153445460)) In my controller I'm using the following to update: @project.update_attributes!(project_params) private def project_params params.permit(:id, { books: [:id] } ) end No matter which attributes I whitelist in permit I can't