Skip to main content
Misconception: Students mix up whether model class names and database table names should be singular or plural in Ruby on Rails.
- Model class names should be singular with the first letter of each word capitalized.
- For example, a model class might be named
LineItem.
- Database table names should be plural with underscores separating words.
- For example, a database table might be named
line_items.
- Note from the CS Teaching Tips Team: For more examples, check out the Ruby on Rails guide to naming conventions.