The thought of parsing the stylesheets to replace url references seems pretty clunky. Could something like Sass address this problem more cleanly?
On Jan 20, 6:29 pm, Corin <wakath...@gmail.com> wrote: > Hi all, > > when using stylesheets caching in rails, one might get problems if the > stylesheets contain relative urls and the cache file is generated in a > different folder than the original one. > > Example > original: stylesheets/jquery/redmond/index.css > cached: stylesheets/cached.all.css > > If the stylesheet contains relative links like "url(images/test.png)" it > get's resolved like this by the browser: > > original: stylesheets/jquery/redmond/images/test.png > cached: stylesheets/images/test.png > > The attached patch contains a join_asset_file_contents_for_css methode, > which gets called by write_asset_file_contents in case the asset is a > stylesheet. > > Instead of a simple join, it parses the css and updates all urls as needed. > > Corin > > join_asset_file_contents_for_css.diff > 2KViewDownload -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-c...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.