I'm using an script to detect internet explorer and display a message. It is not referenced in application.js and I don't want to have it there because it is for one specific page of a controller.
Following this article (ยง3) http://blog.55minutes.com/2012/02/untangling-the-rails-asset-pipeline-part-3-configuration/, I added in my config/development.rb file the following:
config.assets.precompile += ['iealert.js']
Now in my application layout, at the bottom, I have (using haml)
/ [if IE]
= javascript_include_tag "iealert"
The script is included in 2 places, at the bottom, but also in the header (with javascript_include_tag "application", "data-turbolinks-track" => true), therefore all browsers get the alert since the header inclusion is automatic and not conditional.
What am I doing wrong ?