rails01

19
Welcome to Ruby On Rails a Course by @AlSayedGamal

Upload: al-sayed-gamal

Post on 14-Apr-2017

208 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Rails01

Welcome to Ruby On Railsa Course by @AlSayedGamal

Page 2: Rails01

Rails 101Day 1

Page 3: Rails01

AgendaAbout me, you and this course.

What, how and why rails ?

How to get it installed using (RVM).

Same page

git crash course

ruby crash course

Scaffolding

Assignment 01

Page 4: Rails01

About me

@AlSayedGamal

slideshare.net/egamal

github.com/alsayedgamal

have been in development field for almost 9 years.

My main daily work is in rails, python, odoo and OpenStack.

Page 5: Rails01

About youName

Job (if any)

Technical Background

On scale from 0 -> 10 how do you rate yourself in

Linux ?

git ?

ruby ?

rails ?

Page 6: Rails01

About this course

It assumes some background.

It can be called “Rails as in professional environment”.

It requires a lot of hands-on

Dedicate enough time off-class ~5 hours / week.

your github will be involved.

Page 7: Rails01

What’s rails ?

ruby web framework 2005->present.

@DHH, 37Signals

MVC

Rapid application development (Agility).

Page 8: Rails01

What’s rails ? (cont.)

Early and continuous delivery1 feature a time.

DRY

80/20

Testing from day 1

Collaboration is key

Page 9: Rails01

What’s rails ? (cont.)

A ruby gem.

Depends on collection of Loosely coupled gems.

actionmailer

actionpack

actionview

activejob

activemodel

activerecord

activesupport

Page 10: Rails01

How to get started with rails ?

ROR is constantly changing.

ruby shipped with your OS vs RVM.

Gemset and isolation of projects.

.rvmrc

Page 11: Rails01

Your first rails project.

Follow this tutorial

rvm info

rvm gemset create

project/.rvmrc

Page 12: Rails01

Same Page

In this section we will assert some ruby and git knowledge.

This is not detailed section and it will require extra effort from you.

Page 13: Rails01

Ruby Crash Course

Language nature

Basic Syntax

Truly OOP Language

Blocks

Mixins

Page 14: Rails01

Ruby Crash Course Cont.

irb

Expression = Operand + Operators

Data types (all are objects)

5.times {puts “*”}

Operators are functions which are also objects

puts 5.+(5)

Page 15: Rails01

git crash course

Please, refer to this presentation

Page 16: Rails01

Scaffolding

Usually we rarely use scaffold in real application.

However It’s nice to try it to understand how basic rails app work.

Page 17: Rails01

Scaffolding cont.

rails generate scaffold <model> <fields>

Post title: string content: text

rake db:migrate

database.yml

routing:

rake routes

routes.rb

Page 18: Rails01

Assignment 01

Normal Scaffold

Minor Modification of Gemfile

Minor modification of views and controller.

Page 19: Rails01

Thank you!*

*Slides to be posted on slideshare.net/egamal