jstree-rails icon indicating copy to clipboard operation
jstree-rails copied to clipboard

jstree style sheets are not included in assets

Open MobilUser opened this issue 13 years ago • 9 comments

I have the issue that the jstree own CSS files are not included in the asset directory. The individual images of the various themes are under assets/jstree-themes, but the CSS files such as style.css is missing. Is this a config issue on my side?

Txs for any response

MobilUser avatar Feb 20 '12 16:02 MobilUser

I have the same issue on my remote test-sever.

huug avatar Jun 19 '12 13:06 huug

As a workaround I let nginx serve the missing style.css file directly. Couldn't figure out any other solution.

MobilUser avatar Jun 20 '12 06:06 MobilUser

Because my Rails app is not served on the root-uri but on a sub-uri, I removed the first '/' slash in the path:

$.jstree._themes = 'assets/jstree-themes/';

That solved it.

huug avatar Jun 20 '12 08:06 huug

Where did you put that statement in?

MobilUser avatar Jun 20 '12 11:06 MobilUser

in https://github.com/tristanm/jstree-rails/blob/master/vendor/assets/javascripts/jstree.js

huug avatar Jun 21 '12 10:06 huug

try write only config/application.rb

config.assets.precompile += %w(jstree-themes/**/*)

it work in rails 3.2

yuri-zubov avatar Apr 10 '13 11:04 yuri-zubov

I can confirm that editing your config/application.rb as I0Result stated above solved this same problem for me

gregsaunderson avatar Apr 30 '13 12:04 gregsaunderson

I'm having a similar issue. None of the suggestions worked for me. I'm on Rails 4.1.4

I'm getting:

Failed to load resource: the server responded with a status of 404 (Not Found) http://bluebirdcart.com/assets/jstree-themes/default/style.css

Any ideas?

npearson72 avatar Aug 22 '14 09:08 npearson72

I think in Rails 4, the assets are always precompiled with the cache busting string incorporated into the file name. So you can no longer reference assets without using the the helpers to generate the URL (e.g. asset_path(). The solution would be to use ERB to generate this path in the default config in the JS file.

Also, the author of this gem hasn't updated it for a while. The latest version of jstree is 3.0.8 by the looks of things. It might be better to just integrate it yourself under /vendor/assets.

brendon avatar Nov 09 '14 13:11 brendon