Proper use of the gem without stupid things

Despite the fact that this is a very, very simple stone, I believe that I do not understand the idea that is not related to stupid-digest assets ( https://github.com/alexspeller/non-stupid-digest-assets ), so how it does not work on my application.

I need to use CKEDITOR for my application, but the rail digest will ruin everything.

I added this to config / initializers / non_digest_assets.rb:

NonStupidDigestAssets.whitelist = [/ckeditor\/.*/] 

But my ckeditor files are still not showing.

Can someone help me?

0
ruby ruby-on-rails ckeditor asset-pipeline
source share
2 answers

As a starting point for information, the test contradicts the FULL path to the file from the ININ of each resource directory.

At first I thought that maybe his RegEx was wrong, but in fact everything looks fine. In fact, the question may be raised whether RegEx meets your needs. To break it up, you specified a regex here:

 /ckeditor\/.*/ 

Given the following file paths provided:

  • Ckeditor / blah.js
  • ckeditor_blah.js
  • ckEditor.main.js
  • CKEditor / main.js
  • in /ckeditor.css
  • in /CKEditor/extra.css
  • in /blockeditor/base.css
  • ckeditor5 / temp.js

This will only match lines 1, 6 and 7, this is because they are looking for paths that contain the text "ckeditor /" in them. ". *" In Regex, it’s actually superfluous (I think), since it only adds that the string can contain 0 to infinite characters after "ckeditor /".

Another thing is that this is CASE SENSITIVE , so if your file path is actually ckEditor / main.js, as in the 4th line of the above example, it will not match. If you want RegEx to be case insensitive, use:

 /ckeditor\/.*/i 

Hope this helps you sort out the problem ... Here are some additional examples to provide more starting points:

 /^ckeditor/i 

This corresponds to lines 1, 2, 3, 4, and 8 in the example above, since it will look for any path starting with "ckeditor" and case-INsensitive .

 /[\/]*ckeditor[\/]/i 

This corresponds to lines 1, 4, 6, and 7 in the example above. This is a search for any path to the file that may (but not necessarily) begin with "/" and contains "ckeditor /"

 /ckeditor.*[\/]/i 

This will correspond to lines 1, 4, 6, 7 and 8. In essence, any file path containing "ckeditor {any number of any characters except a new line} /" will work.

+1
source share

We faced a similar problem, and this was due to the fact that we needed to redo the assets.

Mina usually handles this for us, but in this case, he skips pre-compiling the assets because he has not detected any changes.

+1
source share

All Articles