mostrar los errores por campo
This commit is contained in:
parent
3ebcb6c2ef
commit
ebc41a9b77
3 changed files with 3 additions and 3 deletions
|
@ -46,7 +46,7 @@ class ConsensosController < ApplicationController
|
||||||
if @consenso.save
|
if @consenso.save
|
||||||
render status: :created
|
render status: :created
|
||||||
else
|
else
|
||||||
render json: { errors: @consenso.errors.full_messages },
|
render json: { errors: @consenso.errors.messages },
|
||||||
status: :unprocessable_entity
|
status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ class PiratasController < ApplicationController
|
||||||
|
|
||||||
return if @pirata.save
|
return if @pirata.save
|
||||||
|
|
||||||
render json: { errors: @pirata.errors.full_messages },
|
render json: { errors: @pirata.errors.messages },
|
||||||
status: :unprocessable_entity
|
status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ class PosicionesController < ApplicationController
|
||||||
if @posicion.try(:save)
|
if @posicion.try(:save)
|
||||||
render status: :created
|
render status: :created
|
||||||
else
|
else
|
||||||
render json: @posicion.try(:errors).try(:full_messages),
|
render json: @posicion.try(:errors).try(:messages),
|
||||||
status: :unprocessable_entity
|
status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue