PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

IE stylesheets get #749

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As of Rails 2.3.8, the html IF tags that are supposed to only include the 
Active Scaffold stylesheet 
if the user is on IE, doesn't seem to work anymore. The html gets escaped and 
the result is the 
<!--[if IE] tags getting output as text on the page, and the IE stylesheet 
getting included no 
matter what. This seems to be caused by the method "active_scaffolds_includes" 
in 
view_helpers.rb (around line 100 to 114). I suggest using the built in user 
agent detection 
instead of relying on html if tags. A suggested fix to the method could be:

      # easy way to include ActiveScaffold assets
      def active_scaffold_includes(*args)
        frontend = args.first.is_a?(Symbol) ? args.shift : :default
        options = args.first.is_a?(Hash) ? args.shift : {}
        js = javascript_include_tag(*active_scaffold_javascripts(frontend).push(options))

        css = stylesheet_link_tag(*active_scaffold_stylesheets(frontend).push(options))
        ie_css = stylesheet_link_tag(*active_scaffold_ie_stylesheets(frontend).push(options))
        ie = ie_css + "\n" if request.env['HTTP_USER_AGENT'] =~ /MSIE/
        js + "\n" + css + "\n" + ie
      end

Then again, I don't know if this is actually just my setup being stupid in some 
way, but I just felt 
like using the "<!-- [if IE]" tags seemed a bit deprecated ;)

- Mark

Original issue reported on code.google.com by markqv...@gmail.com on 26 May 2010 at 5:05

GoogleCodeExporter commented 9 years ago
Sorry, double post. Please reject this one.

Original comment by markqv...@gmail.com on 26 May 2010 at 5:06

GoogleCodeExporter commented 9 years ago

Original comment by sergio.c...@gmail.com on 26 May 2010 at 7:49