image_tag keeping add ???? after the url it generates

hi, all,

I have a problem with image_tag, the url it generates keeps adding ??? at the tail.


I’ve checked the source code of image_tag, and couldn’t find any solution. The ???
is appended to the “source” parameter before it goes to the real image_tag code.

  def image_tag(source, options = {})

    puts source   # already ????? here
    options[:src] = image_path(source)

    options[:alt] ||= File.basename

(options[:src], ‘.*’).split(’.’).first.capitalize

    if options[:size]
      options[:width], options[:height] = options[:size].split("x")
      options.delete :size

    tag("img", options)

I couldn’t debug further because I couldn’t find where the image_tag was invoked.
I think maybe it’s caused by encoding problem because I use utf8 as the default encoding for the project.

Anyone has a solution?

Best Regards,


Anyone has a solution?

Yes, leave it, it’s a feature. It will cause your user’s browser to reload the image whenever it changes and get it from the cache if no change was made. The parameter is the modification date.

Best regards

Peter De Berdt

yes, I know that the timestamp figure is the feature. I’m wondering how does those ??? (question signs) come out?
When a page with many images is loaded, there are so many ??? (question signs) apear and make the page

size really big. I want to find a way to get rid of these ??? (question signs).


That’s weird indeed, I’ve never come across this.

I plan to modify the source code of image_tag to strip out those question signs if there weren’t any better solution.

ok, I solved this by modifying the source code of image_tag as follows

   new_source = image_path(source)
   new_source.gsub!(/\?\?+/,'')  # strip the ending ???? here
   options[:src] = new_source