How do I show valid error message from Rails response

18 Views Asked by At

In Rails, I am able to implement the image upload using images_upload_url option.

images_upload_url: /images/create/.

Problem:

If user sends large image size, we need to send proper error message back to user.

Currently I am sending back the response in below format and I am seeing generic error (HTTP Error: 422')

My response: render json: { error: "Image size too large" } , status: :unprocessable_entity

How do I send response back to tinymce to display right error message

Thanks In Advance

0

There are 0 best solutions below