Getting Started - Ruby on Rails - Architectural Overview

Episode #57 by Teacher's Avatar David Kimura

Summary

For beginners, learn the basic structure of a Ruby on Rails application and the request lifecycle. Learn how different components of a Rails application interact with each other.
rails development 21:50

Resources

Summary

# Terminal
rails new testapp
# create new app with MySQL instead of SQLite
rails new testapp -d mysql 

# Terminal
# Generating a new controller and action
rails generate controller visitors index

# Generating a new scaffold (controller, view, and model)
rails g scaffold user first_name:string last_name

# config/routes.rb
Rails.application.routes.draw do
  resources :users
  get 'visitors/index'
  root to: 'visitors#index'

  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end