Chat with Thomas | Profile

Welcome to the Modern Web Design.

Convention over Configuration

Convention over Configuration is one of the main principles in Ruby on Rails.

The reason behind the Convention over Configuration is because Rails has handles the most common and essential components in web app development.

It means when we define something by names, the system assumes that we have assigned a functionality to it.

For example,

  • A table in database is always in plural nouns.
  • A model class is always capital and singular.
  • In database migration command, "AddColumnToPost" means adding columns to table "posts".
  • Controller action: posts#index will render view in posts/index.html.erb by default.
  • All files inside the config/initializers will be loaded automatically.