Monday, March 7, 2016

Code School CodeTV Screencast Rails Anatomy notes and reviews - Ruby on Rails application folder structure 101

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
  • - Assets: where all the static files will go. e.g. images, stylesheets, javascript files. They are compiled by Sprockets in the Asset Pipeline and served from the /assets directory during web requests
  • - 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. 
  • - Views: where the presentation templates are. Sub folder called Layouts. HTML XML JavaScript
  • - 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 

1 comment:

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid