Newbie : What is the number Rails adds in images URL, etc?

That generates a unique url, forcing a refresh on every request. Especially useful for stylesheets.

Ah! I was wondering the same thing myself.

Caio and Jon’s answers seem to clash…

who is right???

Jon is right

from asset_tag_helper.rb:

def rails_asset_id(source)


File.mtime("#{RAILS_ROOT}/public/#{source}").to_i.to_s rescue “”


File.mtime returns the modification time of the file which is appended to the asset. When the asset is modified the file name changes forcing browsers to pull the updated version.


Jon. but my justification is correct, the purpose is to force a reload.

Rails is clever enough to use a timestamp so as to only force reloads when it really matters.