inflect-js

An inflection helper based on Ryan Schuft's inflection-js

A clone of Ryan Schuft's inflection-js, rewritten to take string arguments rather than monkey patching the core String class.

renders a singular English language noun into its plural form normal results can be overridden by passing in an alternative

renders a plural English language noun into its singular form normal results can be overridden by passing in an alterative

renders a lower case underscored word into camel case the first letter of the result will be upper case unless you pass true also translates "/" into "::" (underscore does the opposite)

renders a camel cased word into words seperated by underscores also translates "::" back into "/" (camelize does the opposite)

renders a lower case and underscored word into human readable form defaults to making the first letter capitalized unless you pass true

renders all characters to lower case and then makes the first upper

renders all underbars and spaces as dashes

renders words into title casing (as for book titles)

renders class names that are prepended by modules into just the class

renders camel cased singular words into their underscored plural form

renders an underscored plural word into its camel cased singular form

renders a class name (camel cased singular noun) into a foreign key defaults to seperating the class from the id with an underbar unless you pass true

renders all numbers found in the string into their sequence like "22nd"