# Stylesheet\_link\_tag, javascript\_include\_tag - food for thought

**URL:** <https://www.ruby-forum.com/t/stylesheet-link-tag-javascript-include-tag-food-for-thought/118426>\
**Category:** Rails\
**Created:** [October 26, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/stylesheet-link-tag-javascript-include-tag-food-for-thought/118426 "2007-10-26T19:56:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle\_n](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7cd45c/32.png) [@kyle\_n](https://www.ruby-forum.com/u/kyle_n)\
**Post date:** [October 26, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/stylesheet-link-tag-javascript-include-tag-food-for-thought/118426/1 "2007-10-26T19:56:48Z")

</div>

stylesheet\_link\_tag and javascript\_include\_tag both have a very handy  
hash options generator at the end of the files.

ie:

def stylesheet\_link\_tag(\*sources)  
options = sources.last.is\_a?(Hash) ?  
sources.pop.stringify\_keys : { }  
sources.collect do |source|  
source = stylesheet\_path(source)  
tag(“link”, { “rel” =\> “Stylesheet”, “type” =\> “text/css”,  
“media” =\> “screen”, “href” =\> source }.merge(options))  
end.join("\n")  
end

Now this is great for 1 machine, but when you are on a clustered  
setup, that merge(options) call is different from machine to machine…  
Thus not being returned as a 304 until each version of that file is  
well, updated!

Perhaps they should include a way to overwrite for multi-machine  
setups. A more suitable approach would be to create a hash key from  
the svn repository number of the file.

Any thoughts?
