0

I have rails application, with sass less and many gems.

I try to find where image_tag is overwrited to debug why it do not add fingerprint hash to url.

I have done rails assets:precompile and files with hash fingerprint are existing in public dir. The problem is on production and in development which I configured (as in production) like this:

config.assets.compile = true
config.assets.digest = true

I tried to search in ~/.gem/gems and ~/.gem/bundler/gems/ and in project folder for def image_tag and :image_tag - no results except place where it is actually defined (actionview-5.0.7.2/lib/action_view/helpers/asset_tag_helper.rb).

I tried to print some from image_tag at asset_tag_helper.rb - no any output, however at asset_path in asset_url_helper.rb output is present but no any image files processed.

Same time image_tag works correct and generate correct tag with options like :size and so on. But do not contain a hash fingerprint

fl-web
  • 462
  • 5
  • 16
  • You need to provide an example which reproduces the behavior your talking about. Otherwise we are just dealing with hypotheticals. – max Apr 17 '20 at 23:15
  • You can put a breakpoint right before calling `image_tag` using byebug or pry and then call `method(:image_tag).source_location` to see where it's defined, but I don't get why you say it's being overriden. You should show your code. – arieljuod Apr 19 '20 at 01:45

1 Answers1

0

The first problem is solved. It was a path - first param of image_tag. When the path begin from / (like /img.png) - this mean an url do not checked for an assets existence and do not modified with a digest. When path is not begin from / (like img.png) then it is checked for assets and the digest is added.

The second problem is not solved. There is no way how to find where actual image_tag function is defined and where and how it is overrided.

fl-web
  • 462
  • 5
  • 16