79297358

Date: 2024-12-20 13:26:30
Score: 1.5
Natty:
Report link

ActiveRecord::RecordInvalid will be triggered if you use save! or create! then you can inspect b.errors See https://api.rubyonrails.org/classes/ActiveRecord/RecordInvalid.html Instead of raising the exception you could do something like

if a.save
  redirect_to a
else
  render json: {errors: a.errors}
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Andrew F