0

Rails appends a timestamp to js and css files to force cache refreshes while in development mode. While this is appropriate most of the time, it backfires when using CSSEdit, for example, that does not take the timestamp append into consideration.

If you attempt to create a new style or edit an existing selector it will attempt to reload the page each time, even though you've opened a file once. This is a conversation I had a long time ago with Jan, however I've never seen a mechanism added to address this situation.

Is anyone aware of either: A) a hack to allow CSSEdit to cut off the ?##### timestamp or B) just simply temporarily disable rails timestamps via the rails server command (or perhaps just throw an awk into it to change a config file via a script to start the rails dev server on localhost)?

3
  • Not familiar with Rails, but could you just not work in development mode? Commented Sep 14, 2011 at 18:57
  • So far I'm finding that editing environment.rb with: ENV["RAILS_ASSET_ID"] = '' accomplishes the desired effect, however I would bet that there's a both a way to run this from the shell w/o sed or such with replacing the line in the environment.rb or simply a better way that others are using. Commented Sep 14, 2011 at 19:03
  • @jondavidjohn no, unfortunately these timestamps are added in dev mode. Commented Sep 14, 2011 at 19:04

1 Answer 1

1

RAILS_ASSET_ID='' rails s actually does the trick for anyone needing to work with CSSEdit and Rails to temporarily disable the modification postfixes when dealing with the cache-buster.

This is handy since it's a temporary solution and will go back to the normal operation when you go back to running rails without the RAILS_ASSET_ID command prepend.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.