Summary: Anatomy of a Ruby on Rails application folder. Ruby on Rails 101 explained in minutes.Author: Evan B. Machnic
Agenda: 1. Folder Structure 2. Key files in an app 3. Reason for defaults
Rating: 5 stars. Excellent resource for getting started learning to code with Ruby on Rails.
- -Section: 1.Folder Structure 2. Key files in an app 3. Reason for Defaults
- - App directory : assets, controllers, helpers, mailers, models, views, config
- - Controllers: has the controllers, which help views and models talk to each other.
- - Helpers: application helpers which make maintaining code easier. Typically use helpers to remove duplications out of the views.
- - Mailers: classes that can handles mails.
- - Models: models. app/models persistent and non-persistent models.
- - Config directory: application configurations. Application.rb file loads the boot.rb (loading bundler which loads up libraries needed by the application) file, loads activerecords action controller, default configurations. Global configurations can be commented or uncommented. Database.yml file configure the database. environment.rb in which we require application.rb can also put environment specific configurations here. Contains the development.rb and production.rb files, can modify development or production environment configurations.
- - config/initializers: contains application-specific configurations, third-party access tokens,
- -locales: for storing different language settings if the app supports multiple languages
- - routes.rb: contains all the routing info for the app. Can also mount other ruby application from inside this file.
- - db directory: database migrations, schemas, seeds. db/schema.rb is the current state of the database