how can i detect browser type and its version in Rails. I want to put check on the version of specific browser and if its not required browser version than ask user to upgrade i
Though this is a frontend solution, I prefer to check for a specific feature that is required, such as flexbox. You can use something like Modernizr, or just a simple JavaScript check will do (https://stackoverflow.com/a/27047981/179311).
if(!("flexWrap" in document.documentElement.style)) {
// IE 10, Chrome 20 and Firefox 27 and anything older will hit this.
alert('your browser is out of date');
// maybe this is preferred
// window.location = '/browser-unsupported'
}