简体   繁体   中英

Assets on nitrous.io are not loading even though html is loading

I am currently developing a website on nitrous and i have some problems.

my html code loads as a home page but there was no images, there were only images of "file not found"

文件未找到

the html was in folder "static_pages", ie. static_pages/home.html.erb while the images are in the same folder. ie. static_pages/images

when i ran rails s and tried to see the web, the images does not load.

Can anyone shed some light on this?

If you reference the image by naked filename (in a view), Rails will retrieve them from app/assets/images/ by default. You mentioned this is a static page, so I assume you are referencing the images with a path. That path would be assumed to be from app/public/ .

If you create a subdirectory app/public/static_images/ you can reference the images in your static HTML page as static_images/filename .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM