Organization
The directories created during installation provide a place for your application code, scripts to help you manage and build your application, and many other goodies. Later, we’ll examine the most interesting directories in greater detail. For now, let’s take a quick pass through the directory tree in the project we created:
- app
This directory has your Rails application. You’ll spend most of your development time working on files in this directory. app has subdirectories that hold the view (views and helpers), controller (controllers), and the backend business logic (models).
- config
This directory contains the small amount of configuration code that your application will need. Your database configuration will go in database.yml. Common environmental configuration, such as the configuration of any mail server your application needs, will go in environment.rb. Rules for your URLs that route incoming web requests go in routes.rb. You can also specifically tailor the behavior of the three Rails environments for test (environments/test.rb), development (environments/development.rb), and production (environments/production.rb) with files found in the environments directory.
- db
Your Rails application will have model objects that access relational database tables. Files that describe the schema (schema.rb) go in this directory. Migrations, Ruby scripts that make it easy to code changes in your database schema, go in the db/migrations directory.
- doc
Ruby has a framework, called RubyDoc ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access