mostrar los errores por campo

This commit is contained in:
fauno 2019-04-20 12:49:31 -03:00
parent 3ebcb6c2ef
commit ebc41a9b77
No known key found for this signature in database
GPG key ID: 456032D717A4CD9C
3 changed files with 3 additions and 3 deletions

View file

@ -46,7 +46,7 @@ class ConsensosController < ApplicationController
if @consenso.save
render status: :created
else
render json: { errors: @consenso.errors.full_messages },
render json: { errors: @consenso.errors.messages },
status: :unprocessable_entity
end
end

View file

@ -16,7 +16,7 @@ class PiratasController < ApplicationController
return if @pirata.save
render json: { errors: @pirata.errors.full_messages },
render json: { errors: @pirata.errors.messages },
status: :unprocessable_entity
end
end

View file

@ -24,7 +24,7 @@ class PosicionesController < ApplicationController
if @posicion.try(:save)
render status: :created
else
render json: @posicion.try(:errors).try(:full_messages),
render json: @posicion.try(:errors).try(:messages),
status: :unprocessable_entity
end
end