Rails outputting the wrong assets path

68 views Asked by At

First here are my dependencies :

ruby '2.2.2'
gem 'rails', '4.2.1'

Following this article, this should work :

image_tag("icon")
# => <img alt="Icon" src="/assets/icon" />

My server debugged:

image_tag("icon")
[2] pry(#<#<Class:0x007fc87e261120>>)> => "<img src=\"/images/icon\" alt=\"Icon\" />"

Why is my server outputting /images/icon instead of /assets/icon. All my images are inside app/assets/images and currently not displaying. What did I do wrong?

Question update

Adding extension such as .png doesn't help still :

pry(#<#<Class:0x007f9095686a00>>)> => "<img src=\"/images/icon.png\" alt=\"Icon\" />"
1

There are 1 answers

2
Abhi On

You are not providing image extension. Provide extension like:

image_tag("icon.png")