Returns a stylesheet link tag for the sources specified as arguments. If
you don’t specify an extension, .css will be appended
automatically. You can modify the link attributes by passing a hash as the
last argument.

Caching multiple stylesheets into one

You can also cache multiple stylesheets into one file, which requires less
HTTP connections and can better be compressed by gzip (leading to faster
transfers). Caching will only happen if
ActionController::Base.perform_caching is set to true (which is the case by
default for the Rails production environment,
but not for the development environment). Examples:

Examples

stylesheet_link_tag:all,:cache=>true# when ActionController::Base.perform_caching is false =><linkhref="/stylesheets/style1.css"media="screen"rel="stylesheet"type="text/css"/><linkhref="/stylesheets/styleB.css"media="screen"rel="stylesheet"type="text/css"/><linkhref="/stylesheets/styleX2.css"media="screen"rel="stylesheet"type="text/css"/>stylesheet_link_tag:all,:cache=>true# when ActionController::Base.perform_caching is true =><linkhref="/stylesheets/all.css"media="screen"rel="stylesheet"type="text/css"/>stylesheet_link_tag"shop","cart","checkout",:cache=>"payment"# when ActionController::Base.perform_caching is false =><linkhref="/stylesheets/shop.css"media="screen"rel="stylesheet"type="text/css"/><linkhref="/stylesheets/cart.css"media="screen"rel="stylesheet"type="text/css"/><linkhref="/stylesheets/checkout.css"media="screen"rel="stylesheet"type="text/css"/>stylesheet_link_tag"shop","cart","checkout",:cache=>"payment"# when ActionController::Base.perform_caching is true =><linkhref="/stylesheets/payment.css"media="screen"rel="stylesheet"type="text/css"/>