Return meaningful error message for 422

private-asciicasts
Marcin Kulik 10 years ago
parent f45ff47737
commit 8264105ca3

@ -11,7 +11,7 @@ module Api
location: asciicast location: asciicast
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
render nothing: true, status: 422 render text: e.record.errors.messages, status: 422
end end
def show def show

Loading…
Cancel
Save