Here you can find the source of humanize()
String.prototype.humanize=function(){ return this[0].toUpperCase()+this.replace(/_/g," ").slice(1); };
String.prototype.humanize = function() { var str; str = this.replace(/_id$/, "").replace(/_/g, ' ').replace(/([a-z\d]*)/gi, function(match) { return match.toLowerCase(); }); return str.split('.').pop(); };
String.prototype.humanize = function() { var str; str = this.replace(/_id$/, "").replace(/_/g, ' ').replace(/([a-z\d]*)/gi, function(match) { return match; }); return str.split('.').pop().charAt(0).toLowerCase() + str.split('.').pop().slice(1); };
String.prototype.humanize = function () var str = this; for (var i = 0; i < str.length; i++) if (str[i] == str[i].toUpperCase()) str = str.substr(0, i) +' '+ str[i].toLowerCase() + str.substr(i + 1); i++; ...
String.prototype.humanize = function() { var s = this.trim().toLowerCase().replace(/[_]+/g, ' '); s = s.replace(/^(.)|\s(.)/g, function($1) { return $1.toUpperCase(); }); return s;