Created
June 12, 2010 00:26
-
-
Save cncolder/435236 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Hold it in application.html.erb or ur own default layout. for this example put in navigator. --> | |
<% if @win_ie_with_chromeframe %> | |
<script> | |
navigator.chromeframe = true; | |
</script> | |
<% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detect chrome frame in application_controller.rb | |
before_filter :chromeframe_detect | |
protected | |
def chromeframe_detect | |
ua = request.user_agent | |
@win_ie_with_chromeframe = ua =~ /Windows NT/ and ua =~ /MSIE (\d+)/ and $1.to_i < 9 and ua =~ /chromeframe/ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment