Ruby on Rails

9
Web Apps with Ruby on Rails (RoR) Jabran Noor 6 August 2015

Transcript of Ruby on Rails

Page 1: Ruby on Rails

Web Apps with Ruby on Rails (RoR)

Jabran Noor6 August 2015

Page 2: Ruby on Rails

Quick overview of the Ruby Language

Rails overview

Models and ActiveRecord

Views and Layouts

Scaffolding

Libraries and Gems

Web Apps with Ruby on Rails - Jabran Noor

Page 3: Ruby on Rails

Overview of Ruby LanguageStrings

Symbols

Numbers

Array

Hashes

Constants

Classes

Modules

Methods

loops

Procs

Metaprogramming

Ruby Magic

IRB

Coding in Ruby is Fun

Requiring Files

LIVE CODING SESSION

Web Apps with Ruby on Rails - Jabran Noor

Boolean

Page 4: Ruby on Rails

Rails Overview

Models

Views

Controllers

ActiveRecord

DRY

MVC

Rails is a MVC Framework

REST API

Convention over

Configuration

ORM

CONCEPTS

Directory Structure

Create Basic App

Web Apps with Ruby on Rails - Jabran Noor

Directory Structure

Page 5: Ruby on Rails

Models and Activerecord

Rails encourages declarative programming

LIVE DEMO

Simple Model

Relationships

ORM

Activerecord

Validations

bin/rails  generate  model  Article  title:string  text:text

Controllersbin/rails  generate  controller  welcome  index

Web Apps with Ruby on Rails - Jabran Noor

Page 6: Ruby on Rails

Views and Layouts

A moduler structure helps build robust views

LIVE DEMO

Layout

Rendering

Form Helpers

JSON / XML

Web Apps with Ruby on Rails - Jabran Noor

Page 7: Ruby on Rails

Scaffolding

Scaffolding gets the basic app running quickly

LIVE DEMO

advantages

disadvantages

scaffold

Web Apps with Ruby on Rails - Jabran Noor

extending app

Page 8: Ruby on Rails

Libraries and Gems

Ruby has excellent libraries

javascript

databases

bootstrap

testing

pdf

bundler

Web Apps with Ruby on Rails - Jabran Noor

Activeadmin

charts

developing APIS

Page 9: Ruby on Rails

DISCUSSION

Web Apps with Ruby on Rails - Jabran Noor

Q & A

COMPARISON WITH OTHER FRAMEWORKS