Here are the specific parameters that need to be processed:
def image_params
params.require(:image).permit(:data, :x, :y, :width, :height)
What exactly is expected for :image
? When sending information from the front-end, it is structured like this:
updateImage: function (e) {
e.preventDefault()
var formData = new FormData()
formData.append(`x`, this.crop_x)
formData.append(`y`, this.crop_y)
formData.append(`width`, this.crop_width)
formData.append(`height`, this.crop_height)
formData.append(`image`, this.imageID)
this.$http.patch(`/articles/${this.id}/images/${this.imageID}`, formData)
}
Assuming that :image
should represent an ID such as 16
.