Skip to content

Instantly share code, notes, and snippets.

@cncolder
Created June 12, 2010 00:26
Show Gist options
  • Save cncolder/435236 to your computer and use it in GitHub Desktop.
Save cncolder/435236 to your computer and use it in GitHub Desktop.
<!-- 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 -%>
# 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