Asset Pipeline simple images do not work in Rails 4.2 -


i have image: sample.png. have verified image.

i put in app/assets/images.

i reference in view with:

image_tag "sample.png" 

it refuses work. created new directory public/assets/images.

still doesn't work.

this needlessly complex. how can see actual image in view?

please note have read of asset pipeline documentation already.

the url being generated is:

/images/sample.png 

actually, image_tag "sample.png" returns link like

<img alt="sample" src="/assets/sample.png"> 

i think running app in production mode, need compile assets

bundle exec rake assets:precompile rails_env=production 

after command , image generate in root_path/public/assets/sample.png

hope works :)


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -