Hello my name is King
I make Rails apps.
# Ruby on Rails Cheatsheet ##### Table of Contents [Basics](#basics) [Connect a Database](#connect-a-database) [Rake](#rake) [Troubleshoots](#troubleshoots) ## Basics #### request/response cycle controller > route > view learn request/response cycle: https://www.codecademy.com/articles/request-response-cycle-forms #### 1. Generate a new Rails app ```bash $ rails new MySite # or using Postgress $ rails new myapp --database=postgresql $ bundle install $ rails server > http://localhost:8000 # or similar Number up and running! ``` #### 2. Generate a controller and add an action ``` $ rails generate controller Pages ``` generates a new controller named Pages Open: app/controllers/pages_controller.rb ```Ruby class PagesController < ApplicationController def home # add the home action/method to the pages controller end end ``` #### 3. Create a route that maps a URL to the controller action Open: config/routes.rb ```Ruby Rails.application.routes.draw do get 'welcome' => 'pages#home' end ``` #### 4. Create a view with HTML and CSS Open: app/views/pages/home.html.erb ```html
I make Rails apps.