Convention over Configuration




Rails Coach show

Summary: The idea behind convention over configuration is that rather than having several or one large configuration file to set up the framework for you to use, Rails uses conventions to determine how things should work without configuration. In many cases in Rails, there are ways to override the default convention, but most people stick to the conventions. The conventions make it easy to set up and get started with Ruby on Rails. They also make it extremely easy for a person unfamiliar with your Rails project to step in and figure out what is going on. Some of the conventions in Rails are the following: A model's class is the camel cased singular version of its table name. The file name is the underscore cased version of the class name. The table name is the underscore cased pluralized model name. So, for example, the User model will be /app/models/user.rb and correspond to the "users" table in the database. Similar conventions apply to controllers, helpers, views, and tests.