When creating a new Rails 4 project, I have javascripts
and stylesheets
directories inside the app/assets
folder, but I no longer see the images
directory. Are we supposed to be putting our images in another folder?
UPDATE: I created an images
directory in the assets
folder. Unfortunately, that doesn't work. If I try to load an image with <img src="/assets/my_image.jpg"/>
, it can't be found. Seems like I need to somehow enable my images
directory?
Rails 4.* now have images folder under app/assets/images/
JS/CSS/IMAGES are now part of the rails app, in previous you might put them under public folder, further reading.
I ran into the same problem and have reached at least a temporary solution. I haven't figured out all the little details yet but here is one thing I have discovered.
I updated my rails 4.0.0.RC2 app to rails 4.0.0 but still had problems with images. However, when I created a new rails 4 app the images rendered just fine. As I searched all over for a solution to the image problem I noticed @at. posted a number of different SO posts about this same issue. I wanted to let you know what I found. I'll update when I find out more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With