Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
rails-master-road-1.pdf
Search
chionyan
February 15, 2019
Programming
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
rails-master-road-1.pdf
chionyan
February 15, 2019
More Decks by chionyan
See All by chionyan
レンタルカメラ広告提案資料
chionyan
0
760
Other Decks in Programming
See All in Programming
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
330
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Railsバージョンを4倍にした話
optim
0
350
JIS keyboard support in Omarchy
lef237
0
110
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
ジョジョの世界をXRで再現する
mofurune
0
160
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
Event is what happens
moro
2
780
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
550
Next.js: The final boss of Web Performance
guaca
0
260
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
610
Done Done
chrislema
187
17k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
460
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
730
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Visualization
eitanlees
153
17k
Leo the Paperboy
mayatellez
10
2.4k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Unsuck your backbone
ammeep
672
58k
Transcript
Ruby on Rails Master への道 〜導入編〜 @chionyan 公開日時:2019/2/15
Rails でアプリを作るのは超簡単!
超簡単 Rails 下準備をする // プロジェクトを作る $ rails new sample-app //
ライブラリを入れる $ bundle install
超簡単 Rails // User に関する色々を作ってくれる $ rails generate scaffold User
name:string em // DB を作る $ rails db:migrate データを操作する色々を作る
超簡単 Rails $ rails server サーバーを起動する
超簡単 Rails できました!
超簡単 Rails User を作成することもできる!
超簡単 Rails User を作成することもできる!
超簡単 Rails 一覧にも出てくる!
すごーい!!!
Rails チュートリアル Rails チュートリアルでは、 scaffold がよしなにやってくれた内容を、 ・Routing ・Model ・Controller ・View
・バリデーション、関連、セッション... など一つ一つ基礎の部分を写経して、 アプリケーションを作っていく。
でも、、
実際何やってるの??
Ruby を知る ポテンシャルエンジニア研修で も使った名著。 Rails のフレームワークで使われ ている Ruby について丁寧に解 説してある。
まずはこれで Ruby を知ろう。 「プロを目指す人のための Ruby 入門」
Rails を知ろう 「Ruby on Rails ガイド」
Ruby on Rails ガイド ガイド目次です。 さっき4つくらいのコマンドで 終わったことや、モデル、ビュ ー、コントローラーで行われて いることもここで細かく説明さ れています。
多い・・・。
ちょっとだけ見せ
Active Record マイグレーション # 下記のコードが作成される(DB 作る用) class AddLocationToUsers < ActiveRecord::Migration
def change add_column :users, :location, :string end end // users テーブルに location カラムを追加する $ rails g migration AddLocationToUsers locati // DB を更新する $ rails g db:migrate
Active Record マイグレーション class AddLocationToUsers < ActiveRecord::Migration def up add_column
:users, :location, :string end def down remove_column :users, :location, :string end end こう手直しした方が融通が効きやすい!! (可逆性がある)
そういうことがわかります。。
もっと知りたい人は、
こことか、こことか
rails / rails User を作成することもできる!
読めたらいいな。。。
おしまい