I’m using a Rails blogging gem Enki on Heroku, but am having trouble posting images. Out of the box it doesn’t come with a way to insert images to pages or posts. I created a page and put different paths to the image (it’s a rails 3.0.4) but the image isn’t showing up on the page.
<img src="http://blooming-sunrise-4472.heroku.com/public/images/rails.png" alt="Rails" width="50" height="50" />
<img src="public/images/rails.png" alt="Rails" width="50" height="50" />
I know the Rails.png is on github but I’m wondering if it’s actually on the Heroku site, or is there a problem with how I’m trying to access it?
I logged into my Heroku account, but I can’t see anywhere that let’s you know what is on their servers.
Can anyone suggest anything?
The url is My Heroku App If you click on “image-test” under the pages heading, you will see the page where the images are supposed to be displayed?
Note, having done Michael Hartl’s RailsTutorial.org, I know that images can be moved from Github to Heroku, even though I’ve read SO questions that say can’t store on Heroku servers
This is a simple error,
files in the
/publicdirectory are treated as theDocumentRootof your application.So you should refer to “images/rails.png”, not “public/images/rails.png”
as such, replace your
<img>tag with