KEMBAR78
Rails01 | PDF
Welcome to
Ruby On Rails
a Course by @AlSayedGamal
Rails 101
Day 1
Agenda
About 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
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.
About you
Name
Job (if any)
Technical Background
On scale from 0 -> 10 how do
you rate yourself in
Linux ?
git ?
ruby ?
rails ?

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.
What’s rails ?
ruby web framework

2005->present.
@DHH, 37Signals
MVC
Rapid application
development
(Agility).
What’s rails ?
(cont.)
Early and
continuous delivery

1 feature a time.
DRY
80/20
Testing from day 1
Collaboration is key
What’s rails ?
(cont.)
A ruby gem.
Depends on collection of
Loosely coupled gems.
actionmailer
actionpack
actionview
activejob
activemodel
activerecord
activesupport
How to get started
with rails ?
ROR is constantly
changing.
ruby shipped with
your OS vs RVM.
Gemset and
isolation of
projects.
.rvmrc
Your first rails
project.
Follow this tutorial
rvm info
rvm gemset create
project/.rvmrc
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.
Ruby Crash Course
Language nature
Basic Syntax
Truly OOP Language
Blocks
Mixins
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)
git crash course
Please, refer to this
presentation
Scaffolding
Usually we rarely
use scaffold in real
application.
However It’s nice to
try it to
understand how
basic rails app
work.
Scaffolding
cont.
rails generate scaffold
<model> <fields>
Post

title: string

content: text
rake db:migrate
database.yml
routing:
rake routes
routes.rb
Assignment 01
Normal Scaffold
Minor Modification
of Gemfile
Minor modification
of views and
controller.
Thank you!*
*Slides to be posted on slideshare.net/egamal

Rails01