I want to display a picture on the page:

<%= link_to image_tag("rails.png", alt: "Rails logo"), 'http://rubyonrails.org/' %> 

The picture is at app / assets / images / rails.png
In the source code of the page, the image is displayed as:

 <img alt="Rails logo" src="/images/rails.png"> 

How can this be fixed?
Where is the config file to set the prefix correctly?

  • Well, in general, everything is written correctly. Maybe some kind of problem with access to the picture itself? - check1st
  • @ check1st wrong way it gives out. By default, Rails distributes everything along the path /assets/ , and then hash is assigned to the file names. - Colibri
  • there is still a second question, Where is the config file to set the prefix correctly? Thanks for answers. - alwizo

0