开发者

Rails CSS and JavaScript modified appends & CSSEdit?

开发者 https://www.devze.com 2023-04-05 09:52 出处:网络
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

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 t开发者_如何学Gohough 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)?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消