Upload
yohei-yasukawa
View
153
Download
0
Embed Size (px)
Citation preview
3 #Rails
http://railstutorial.jp/
Rails
by YassLab
Slideshare
http://www.slideshare.net/yasulab/presentations
Cloud9
1. 2. URL 3.
https://ide.c9.io/yasulab/rails-tutorial
https://rails-tutorial-yasulab.c9users.io/
URL “Collaborate” → “Group Chat”
! :)
Ready?
!
3 #Rails
http://railstutorial.jp/
Rails
by YassLab
• Scaffold
•
• REST , Rails
.
• scaffold . scaffold .
• ,
!!
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
2
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
3
• .
• scaffold .
• .
• .
• ( ).
• DRY(Don’t Repeat Yourself)
• DRY
3 3.1
http://railstutorial.jp/
Rails
by YassLab
1. Rails 5.0.0.1 sample_app $ rails _5.0.0.1_ new sample_app
2. Gemfile / bundle install
3. Git / README
4. BitBucket (or GitHub)
5. Heroku
3.1
: git branch
master master mastermastercommit commit commit
: git branch
master master mastermaster
master
fill-in
master
fill-in
commit commit commit
checkout -b fill-in
commit
merge fill-in
master
checkout mastercheckout fill-in
3 3.2
http://railstutorial.jp/
Rails
by YassLab
• StaticPages :$ rails generate controller StaticPages home help
1. Rails Router
2. StaticPages Controller
3. StaticPages View
1. Home
2. Help
3.2
:
3 3.3
http://railstutorial.jp/
Rails
by YassLab
1.
2. ::
Red → Green → Refactor
• Home/Help
• About
3.
3.3
1.
2. ::
Red → Green → Refactor
• Home/Help
• About
3.
3.3
Router
Controller
View
Model
DatabaseReq.
HTML
Action not found
NameError: undefined local …
Missing a template
☝
: ( : )
• :
•
• ( )
•
• :
•
• HTML
• ! 😸 →
•
• /
• →WIP PR→ → 👌✨
• … 😓 →
• Demo Proof of Concept
: ( : )
:
3 3.4
http://railstutorial.jp/
Rails
by YassLab
• TDD 1. RED ( ) 2. GREEN ( ) 3. REFACTOR ERB (👈 )
• 1. 2. 3. Heroku
3.4
:
Home Home | Ruby on Rails Tutorial Sample App
Help Help | Ruby on Rails Tutorial Sample App
About About | Ruby on Rails Tutorial Sample App
Router
Controller
View
Model
DatabaseReq.
HTML
☝
• TDD 1. RED ( ) 2. GREEN ( ) 3. REFACTOR ERB (👈 )
• 1. 2. 3. Heroku
3.4
•
• scaffold :
•
•
•
• rails generate About
• TDD DRY
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
3
Rails http://railsguides.jp/getting_started.html
http://railsguides.jp/layouts_and_rendering.html
Railshttp://railsguides.jp/routing.html
!( ! 📝)
!
3 #Rails
http://railstutorial.jp/
Rails
by YassLab