This is awesome, i'll be implementing this instead of the action text embeds so I have more control over the layout when displaying images and other documents. thank you!
I do have a question, if i wanted to place this on an existing record and remotely update on the record how would I go about handling the array of multiple files/images? I've tacked on the below to the "addedfile" method but getting a 'unpermitted param evidences' error even though I have evidences: [] permitted in params. I think it's how i'm formatting the params in the formData.append - any clues? (I've got this working with one file)
let formData = new FormData()
formData.append("event[evidences]", this.hiddenInput.value);
Rails.ajax({
url: this.data.get("update-url"),
type: "PATCH",
data: formData
});
Thanks for the quick reply, It's actually coming through as Parameters: {"event"=>{"evidences"=>"event[evidences][]"}, "id"=>"22"} which tells me I may not need append, but removing this throws a 'event not present' error for the params.