API Reference util.inflector Class Defined in lib/util/inflector.js:1 Description Inflector. Methods classify (str) String static Defined in lib/util/inflector.js:291 Creates a class name. Parameters str String Returns String dasherize (str) String static Defined in lib/util/inflector.js:304 Replaces underscores with dashes in the string. Parameters str String Returns String foreignKey (str, sep) String static Defined in lib/util/inflector.js:344 Creates a foreign key name from a class name. separate_class_name_and_id_with_underscore setswhether the method should put ‘_’ between the name and ‘id’. Parameters str String sep Boolean Returns String humanize (str) String static Defined in lib/util/inflector.js:212 Capitalizes the first word, turns underscores into spaces and strip a trailing “_id”. Parameters str String Returns String ordinal (num) String static Defined in lib/util/inflector.js:361 Returns the suffix that should be added to a number to denote the position inan ordered sequence such as 1st, 2nd, 3rd, 4th. Parameters num Number Returns String ordinalize (num) String static Defined in lib/util/inflector.js:390 Turns a number into an ordinal string used to denote the position in an ordered sequencesuch as 1st, 2nd, 3rd, 4th. Parameters num Number Returns String parameterize (str) String static Defined in lib/util/inflector.js:317 Replaces special characters in a string so that it may be used as part of a ‘pretty’ URL. Parameters str String Returns String pluralize (str) String static Defined in lib/util/inflector.js:101 Returns the plural form of the string. Parameters str String Returns String singularize (str) String static Defined in lib/util/inflector.js:135 Returns the singular form of the string. Parameters str String Returns String singularize (str, uppercase) String static Defined in lib/util/inflector.js:167 Converts the string to CamelCase. Parameters str String uppercase Boolean Returns String startcase (str) String static Defined in lib/util/inflector.js:230 Capitalizes all the words. Parameters str String Returns String tableize (str) String static Defined in lib/util/inflector.js:278 Creates a name of a table. Parameters str String Returns String titleize (str) String static Defined in lib/util/inflector.js:250 Capitalizes all the words, except for articles, prepositions, and conjunctions. titleize is also aliased as titlecase. Parameters str String Returns String underscore (str) String static Defined in lib/util/inflector.js:191 Returns an underscored, lowercased form of the string. Parameters str String Returns String