Exactly. Here's one I whipped up recently, with support for IE6 and IE7.

  def stylesheet_include_tag
stylesheets = [ "application", "#{controller.controller_name}", "ie7", "ie6" ]
    stylesheets.collect! do |name|
      if File.exist?("#{RAILS_ROOT}/public/stylesheets/#{name}.css")
        case name
        when "ie7"
"<!--[if IE 7]>\n" + stylesheet_link_tag(name) + "\n<! [endif]-->"
        when "ie6"
"<!--[if IE 6]>\n" + stylesheet_link_tag(name) + "\n<! [endif]-->"
        else
          stylesheet_link_tag(name)
        end
      end
    end
    stylesheets.compact.join("\n")
  end

-- Patrick


On Feb 23, 2007, at 4:39 PM, Chris Abad wrote:

I do something similar to segment my stylesheets.
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to