Download - Rails01
![Page 1: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/1.jpg)
Welcome to Ruby On Railsa Course by @AlSayedGamal
![Page 2: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/2.jpg)
Rails 101Day 1
![Page 3: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/3.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/4.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/5.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/6.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/7.jpg)
What’s rails ?
ruby web framework 2005->present.
@DHH, 37Signals
MVC
Rapid application development (Agility).
![Page 8: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/8.jpg)
What’s rails ? (cont.)
Early and continuous delivery1 feature a time.
DRY
80/20
Testing from day 1
Collaboration is key
![Page 9: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/9.jpg)
What’s rails ? (cont.)
A ruby gem.
Depends on collection of Loosely coupled gems.
actionmailer
actionpack
actionview
activejob
activemodel
activerecord
activesupport
![Page 10: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/10.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/11.jpg)
Your first rails project.
Follow this tutorial
rvm info
rvm gemset create
project/.rvmrc
![Page 12: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/12.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/13.jpg)
Ruby Crash Course
Language nature
Basic Syntax
Truly OOP Language
Blocks
Mixins
![Page 14: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/14.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/15.jpg)
git crash course
Please, refer to this presentation
![Page 16: Rails01](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/16.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/17.jpg)
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](https://reader034.vdocuments.net/reader034/viewer/2022042723/5884db9a1a28ab4b778b50ad/html5/thumbnails/18.jpg)
Assignment 01
Normal Scaffold
Minor Modification of Gemfile
Minor modification of views and controller.