Introduction to Rails

What is Rails

  • Is ruby in practice
  • Is a tool
  • Is a framework

Framework

  • A structure for doing things in an organized manner, the term is not technical and applies to many fields especially Law.

Practise

# Example
rails new app_name

# Practical

rails new blog 

Design Pattern

  • Is a particular way of solving a recurring common problem
  • MVC

Model

  • This is where we store the data that underlies the solution or application that we are building.
  • Holds the domain logic and business objects that interact with the database.

Controller

  • Controllers are unique in the sense that they seat in between models and views
  • In conjunction with the router, they handle the internal navigation of your rails app.

HTTP and the web

 

  • Request and Response
  • HTTP is stateless
  • REST - Set of commands that can modify state by visiting a particular URL
  • Resource - The state/thing that is modified by CRUD

View

  • Handles presentation of content to user
  • Most user interaction happens here

MVC in Practise

Where to run to after this

  1. Official rails tutorial     http://guides.rubyonrails.org/getting_started.html
  2. Jumpstart will jumpstart your rails development             http://tutorials.jumpstartlab.com/
  3. Rails for zombies
      http://railsforzombies.org/

 

Introduction to Rails

By Alvin Kato

Introduction to Rails

Rails in a nutshell

  • 227