Philippe DIOLLOT

Joined

10 Experience
0 Lessons Completed
0 Questions Solved

Activity

Hi everybody,
I'm facing an issue I'll quickly describe.
I'm using rails 6 and was using Webpack to get ActiveStorage ActionText and Trix working all togother. Everything was OK : text edit and multiple files uploading via trix. WOUHOU !!!!

But.

Now, I going back to Sprockets. My custommer is asking me for.
So, here is what I did.

  • Checking ActiveStorage working with a simple f.file_field to upload images = OK!
  • Installed Trix with one of the existing gems. = OK for text editing :)
  • Trying to upload files with trix : KO !!

So,

  • Why it was working with Webpack ? Is it because of the upload js file you're using in this video ? This file was present in the node_module trix but not in the gem ?
  • I've tried the file you're using but it doesn't work. I've got console error : "Uncaught TypeError: Cannot read property 'preview' of undefined" on the line "Trix.config.attachments.preview.caption = ..."
  • What gem would you use for my config : Rails6 + Sprockets ?

Can someone help me please ?

Thanks a lot.

Philippe