Browser Detection Using Javascript
This article will help you solving browser compatibility issue. To make detection more robust, here included browser-specific characteristics which is different according to browser. Opera 8.0+ var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; Firefox 1.0+ var isFirefox = typeof InstallTrigger !== 'undefined'; Safari 9.1.3+ var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification); Internet Explorer 6-11 var isIE = /*@cc_on!@*/false || !!document.documentMode; Chrome 1+ var isChrome = !!window.chrome && !!window.chrome.webstore; Successfully tested
Table Print
Table Print on Rails Console TablePrint shows objects in nicely formatted columns for easy reading. It even lets you nest other tables of related objects, contextualizing data across tables. It's incredibly flexible, yet simple, making it easy to see exactly the data you care about. Installation Install as a standalone gem $ gem install table_print Or install within rails In your Gemfile: gem "table_print" $ bundle install Usage Outside rails $ irb > require 'table_print' > tp array_of_objects, options Inside rails, the gem has already been required by your Gemfile so all you need to do
Autolink In Javascript
autolink-js is a small (about half a kilobyte), simple, and tested JavaScript tool that takes a string of text, finds URLs within it, and hyperlinks them. autolink-js adds an autoLink() method to JavaScript's String prototype, so you can use it on any JavaScript string. Take a look at the tests, but essentially, after including either autolink.js or autolink-min.js to your page, it works like this: Input : "This is a link to Google http://google.com".autoLink() Output : "This is a link to Google <a href='http://google.com'>http://google.com</a&