I use this method to render validation errors (note that you don't use the serializer at all):
def render_validation_errors errors
render json: {errors: errors.to_h}, status: 422
end
You would use it like this:
def create
model = Model.new model_params
if model.save
respond_with model
else
render_validation_errors model.errors
end
end
The format expected by ActiveModelAdapter is:
{"errors":{"title":"should begin with a capital letter"}}