Last active
December 16, 2015 21:29
-
-
Save rderoldan1/5499919 to your computer and use it in GitHub Desktop.
image_tag with blank url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def image_tag(img , options={}) | |
path = "#{Rails.root}/app/assets/images/#{img}" | |
img = "missing.png" unless img.present? and File.file?(path) | |
super(img, options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment