Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Table of Contents

Getting Started

Installation

  • Install RVM
  • Install Ruby
  • Install Rails

Generate the Blog Application

  • rails new blog
  • Browse the generated code
  • Play around in the console

Start the Server

Active Record

CRUD

Association

  • one-to-one
  • one-to-many
  • many-to-many
  • belongs to

Migration

  • rake db:migrate

Validation

Query Interface

  • Conditions
  • Ordering
  • Pagination
  • Group

Action View

  • ERB (HTML with embedded Ruby)
  • Haml / Slim
  • render
  • Layout
  • Partial

Action Controller

  • Action
  • Parameters
  • Session
  • Flash message
  • Cookie
  • Error handling
  • Routing

Many comments to one post

  • Generate a comment model
  • Run the migration
  • Create one_to_many association
  • Create comments controller
  • CRUD actions and views for comments
  • Configure the routes

Deploy on Heroku

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment