Skip to content

Instantly share code, notes, and snippets.

@rderoldan1
Last active December 16, 2015 21:29
Show Gist options
  • Save rderoldan1/5499919 to your computer and use it in GitHub Desktop.
Save rderoldan1/5499919 to your computer and use it in GitHub Desktop.
image_tag with blank url
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