I developed a web-based application with the backend built on Rails 5. Utilizing AngularJS for the frontend, I opted to not use the Asset Pipeline to deliver static content. Instead, I loaded all my scripts (JS & CSS) in the index.html file located within the public directory
. From there, I utilized Angular's ng-route for further location management.
An issue arises when one of my HTML pages requires the inclusion of an image using the standard HTML image tag, as the server cannot locate the image file.
<img src="assets/images/logo.jpg" style="padding-bottom:20px;" />
While attempting to store the image both in the app/assets/images
and public/assets/images
directories, I consistently encountered routing errors indicating no route found on my Rails server console.
Following advice from various sources, I added this line to my config development.rb file:
config.public_file_server.enabled = true
However, this solution proved ineffective. How can I successfully serve images without relying on the Rails Assetpipeline?