public Method

Inflector.tableize(class_name)

Create the name of a table like Rails does for models to table names. This method uses the pluralize method on the last word in the string.

Examples

"RawScaledScorer".tableize #=> "raw_scaled_scorers"
"egg_and_ham".tableize #=> "egg_and_hams"
"fancyCategory".tableize #=> "fancy_categories"

Source Code

# File merb/core_ext/inflector.rb, line 210
def tableize(class_name)
  pluralize(underscore(class_name))
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.