tristanm / jstree-rails

A gem to automate using jsTree with Rails 3
Other
26 stars 36 forks source link

jstree style sheets are not included in assets #5

Open MobilUser opened 12 years ago

MobilUser commented 12 years ago

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

huug commented 12 years ago

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

MobilUser commented 12 years ago

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

huug commented 12 years ago

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.

MobilUser commented 12 years ago

Where did you put that statement in?

huug commented 12 years ago

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

yuri-zubov commented 11 years ago

try write only config/application.rb

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

it work in rails 3.2

gregsaunderson commented 11 years ago

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

npearson72 commented 10 years ago

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?

brendon commented 9 years ago

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.