In this post, we will discuss about Rails project directory structure.
Here is the directory structure:
This directory organizes all the components of the application. We will be writing most of our code under this directory.
This directory contains all controller classes for your application. Controllers are classes with methods that defines the application flow like urls, redirects etc.
Put all helper classes here. Helpers provides methods that can be used in views of your application. They are automatically included in views.
This folder contains classes that are used for sending emails.
This directory contains the classes that corresponds to your models.
All the view files (front end -> html, erb) are stored here.
This directory contains the bundle, rails and rake executables that are needed to execute various rails commands
This directory stores all the application configuration settings like database, routes, environment settings etc.
This directory contains the migration files that specifies the table structure. If you are using SQLite, its file will be stored here.
Not used in most of the cases. If you want to write custom code for your application like helper for your controllers, you put them here.
All your application logs will be stored here.
This directory serve contents that are directory available to the world. For example, put a test.html here and it can be called like http://your_website/test.html
This directory is used for creating test cases for the application.
Here rails stores all temporary data like cache, session etc.
3rd party gems that are not handled by bundler are placed here. This directory should not be required in most of the cases.
This file contains all your required software (called gems) for your application. The bundle install command reads this file and downloads all the requirements and their dependencies.