What is the Rails Convention over Configuration principle?

Beginner

Answer

Convention over Configuration means Rails makes assumptions about what you want to do and how you'll do it, rather than requiring you to specify every detail. Examples include:

  • Model User maps to database table users
  • Controller UsersController handles /users routes
  • Primary keys are named id
  • Foreign keys follow pattern table_id

This reduces the amount of code developers need to write and maintains consistency across projects.

ActiveRecord & Database