Tuesday, April 12, 2011

SHARE - Client OS Detection

    <%= request.env['HTTP_USER_AGENT'] %>
    <%= request.env['HTTP_USER_AGENT'] =~ /Linux/ %>
    <%= request.env['HTTP_USER_AGENT'] =~ /Windows/ %>
    <%= request.env['HTTP_USER_AGENT'] =~ /Mac/ %>
    <%= request.env['HTTP_USER_AGENT'] =~ /iPhone/ %>

No comments:

Post a Comment