سؤال

I'm using a star rating jquery plugin that requires a few star images in my rails 4 application. The images aren't showing up and I keep getting an error saying

ActionController::RoutingError (No route matches [GET] "/star-on.png"):

similar to this issue and I tried to move the location of my images but it didn't work, still got the same error. they're currently in app/assets/javascripts/images but I moved them into the root directory and it didn't fix the issue. I also tried editing the javascript to change the path of the images but that didn't work either. I also tried this but it didn't work as well. Any help on this would be really appreciated, thank you.

هل كانت مفيدة؟

المحلول

When ActionController::RoutingError (No route matches [GET] "/star-on.png") error was raised your image had to be in root/public directory to prevent this error. In general, your images should be in root/app/assets/images or in root/vendor/assets/images directory. I don't know what image paths are in the jquery plugin, therefore I can't answer your question. Maybe locating images in the same folder where .js files are located will also solve the problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top