Upload
yohei-yasukawa
View
240
Download
1
Embed Size (px)
Citation preview
7 #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?
!
7 #Rails
http://railstutorial.jp/
Rails
by YassLab
1. cf. rails generate model Users name:string email:string
2. ? ?
3. has_secure_passoword
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
3
5
6
4
Model-View-Controller (MVC)
Router
Controller
View
Model
DatabaseReq.
HTML
7
Rails Web Application (API)User.create
POST/users
GET/users/1
PATCH/users/1
DELETE/user/1
User.find(1) User.find(1).update_attributes
User.find(1).destroy
HTTP Req. (GET)
7 108~9
1. / /
2. / form_for
3. Strong Parameters /
4. / flash
7 7.1
http://railstutorial.jp/
Rails
by YassLab
1.
2. debugger (byebug gem)
3. Users routes
4. show
5.
6. Gravatar
7.1
1. debugger
2. Rails debugger ( : GET /users/1 )
3. debugger
byebug gem
byebug
help
list 10 10
list- 10 10
list= debugger
backtrace ( )
up / down /
edit
byebug
thread listthread switch /
next debugger (method )
step debugger (step )
var localvar global
display
quit (Rails )
Ctrl-D byebug (Rails )
Users RESTful URL
7 7.2
http://railstutorial.jp/
Rails
by YassLab
✨
1. form_for
2. form_for HTML
7.2
7 7.3
http://railstutorial.jp/
Rails
by YassLab
7.3
1. create
2. Rails
3. Strong Parameters
4.
5.
6. assert_no_difference
7.3
7 7.4
http://railstutorial.jp/
Rails
by YassLab
7.3
1. show
2. flash
3. DB $ rails db:migrate:reset
4. rails console DB
5. Test→Merge→Push Heroku 🚀 $ heroku run rake db:migrate !
7.4
7 7.5
http://railstutorial.jp/
Rails
by YassLab
1. SSL ( herokuapp.com SSL ) config/environments/production.rb
2. Web (Puma) puma gem config/puma.rb Profile Puma
3. Heroku !
7.5
!
⚠
1. / /
2. / form_for
3. Strong Parameters /
4. / flash
7 98~9
Rails http://railsguides.jp/debugging_rails_applications.html
Action Controller http://railsguides.jp/action_controller_overview.html
Action View http://railsguides.jp/form_helpers.html
7 #Rails
http://railstutorial.jp/
Rails
by YassLab