Module: Stylist::ViewHelpers

Defined in:
lib/stylist/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#render_stylesheetsObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/stylist/view_helpers.rb', line 3

def render_stylesheets
  Stylist.stylesheets.process!
  html = Stylist.stylesheets.inject('') do |html, (media, stylesheets)|
    html << stylesheet_link_tag(*(stylesheets +
      [ :media => media.to_s,
        :recursive => true,
        :cache => "all-#{stylesheets.hash.to_s}" ]))
  end
  html.respond_to?(:html_safe) ? html.html_safe : html
end