Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rails-resource-routing-design-bootstrap(ja)
Search
MOROHASHI Kyosuke
July 23, 2012
Programming
4
2k
Rails-resource-routing-design-bootstrap(ja)
Sendagaya.rb#12での講演資料に口頭のまとめを追記したものです。
MOROHASHI Kyosuke
July 23, 2012
Tweet
Share
More Decks by MOROHASHI Kyosuke
See All by MOROHASHI Kyosuke
Identifying User Idenity
moro
9
14k
Simplicity on Rails -- RDB, REST and Ruby
moro
14
17k
ちょうどよい Rails E2E テスト/enough-good-rails-e2e-test
moro
5
2.3k
フレームワークを作らない方法/How NOT to build frameworks
moro
4
1.1k
全体がいい感じになるために、私たちRailsをホームにするWeb技術者ができること/let-our-whole-system-grow
moro
2
1.9k
フォームオブジェクトとの向き合い方/Grow Form Objects up
moro
1
1.9k
チームによるいきいきとしたソフトウェア開発/an-alive-team-grows-software
moro
3
3.3k
Web-E2E-Testing-from-Ruby
moro
5
510
Joyful user foundation restructuring with Ruby
moro
9
19k
Other Decks in Programming
See All in Programming
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
5
1.2k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
130
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
250
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
890
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
120
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
180
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
190
AppRouterを用いた大規模サービス開発におけるディレクトリ構成の変遷と問題点
eiganken
1
200
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
360
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
7.2k
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
140
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
120
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
For a Future-Friendly Web
brad_frost
175
9.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
470
Statistics for Hackers
jakevdp
796
220k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
310
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Transcript
पΊͷ Ϧιʔεઃܭ Eiwa System Management, Inc ॾڮګհ (@moro) 2012-07-23 #sendagaya.rb
http://amzn.to/rails3recipebook
http://tatsu-zine.com/books/cuke
·ͱΊ w3BJMTͷ63-ઃܭɺϦιʔεΛͲ͏ ݟग़͔͕͢ݤ w%#ςʔϒϧͱࣅΔ͜ͱ͋Δ͚Ͳඞͣ ͠ରԠ͠ͳ͍ wͺͬͱݟ͑ͳ͍Ϧιʔε୳͢ͷ͕؊ཁ wؔ࿈ΤϯςΟςΟ ྫregistrations wʮॲཧʯΛද͢Ϧιʔε ྫimports
ه
3BJMTͷϦιʔεઃܭ wSPVUFTSCΞϓϦέʔγϣϯ͕ఏڙ ͢ΔϦιʔεΛఆٛ͢Δɻ w·ͣΞϓϦέʔγϣϯ͕ѻ͏ใΛ ཧ͢Δͷ͕ઌɻ w͝ࢀߟhttp://togetter.com/li/341718
3BJMTYҎ߱ 3&45GVM wϦιʔεϢʔβ͕ѻ͍͍͢୯Ґʹ· ͱΊͨใ wˢ͜ΕΛ͍Ζ͍Ζ͍͡Δ͜ͱͰαʔϏ εΛ࣮ݱ͢Δͷ͕Ϩʔϧ wurl_forͱ͔fom_forͱ͔͍Ζ͍Ζ લఏʹͳͬͯΔ
ϦιʔεΛ͍͡Δͧ Ұཡ ୯Ұදࣔ ࡞ ߋ৽ আ GET /res index GET
/res/:id show POST /res create PUT /res/:id update DELETE /res/:id destroy
Πϕϯτ: ΄͛;͕ ݱࡏͷࢀՃऀҰཡ - alice - bob - charles ࢀՃొ͢Δ
͜Ε!!
ѻ͏ใ w·ͣɺը໘ʹඞཁͦ͏ͳใΛɺ%# ʹ֨ೲ͢Δํ๏Λߟ͑Α͏ wྫΠϕϯτʹొΞϓϦ
events users registrations 0..* 0..* 1 1 Event, has_many :users,
through: :registrations
•/events/42/add_users wΠϕϯτʹϢʔβΛՃ͢Δ •/events/42/registrations wΠϕϯτͷࢀՃొใΛ࡞Δ ؔ࿈ϦιʔεΛ࡞Δ
ϨίʔυʺϦιʔε wࣅ͍ͯΔ͜ͱ͋Δɻͱ͘ʹؔ࿈ςʔ ϒϧͱ͔ɻ wࣅ͍ͯͳ͍͜ͱ͋Δɻ࣮ΤϯςΟ ςΟΛ͍͡Δ߹ͱ͔ɻ
ͨͿΜlabelsผςʔϒϧ
ϨίʔυʺϦιʔε wԿΛݟͤΔ͔ɺͲ͏·ͱΊΔ͔ɺͱ͍ ͏ͷ6*ͷ࡞ΓͰஅ͢Δɻ wવɺͯ͢ͷςʔϒϧʹରԠ͢ΔϦ ιʔεఆٛͳͲෆཁ w3BJMT"ENJOͰΖ͏
SFTPVSDFTͷΞΫγϣϯୡ wͥΜͿΘͳͯ͘Α͍ wҰཡܥJOEFY w୯ମ$36%TIPX DSFBUF VQEBUF EFTUSPZ wOFX FEJU6*ͬΆ͍ͷ
Πϕϯτ: ΄͛;͕ ݱࡏͷࢀՃऀҰཡ - alice -bob - charles ࢀՃొ͢Δ POST
/events/42/registrations ·ͨ GET /events/42/registrations/new
όονॲཧ wτϥϯβΫγϣϯϦιʔεΛ࡞Δ wPOST /importsͰॲཧ։࢝ wGET /imports/42Ͱਐ݁ՌΛදࣔ
NFNCFSͱ DPMMFDUJPO wNFNCFSɺͦͷϦιʔεͷҰ෦ͩ ͚Λѻ͏ɻʮϝϯόมʯͷϝϯό wωετͨ͠SFTPVSDF ୯ ʹ͢Δ͜ ͱ͋Δ w/users/42/tokenͱ͔ wDPMMFDUJPOJOEFYͷ෦ू߹ɻ
·ͱΊ w3BJMTͷ63-ઃܭɺϦιʔεΛͲ͏ ݟग़͔͕͢ݤ w%#ςʔϒϧͱࣅΔ͜ͱ͋Δ͚Ͳඞͣ ͠ରԠ͠ͳ͍ wͺͬͱݟ͑ͳ͍Ϧιʔε୳͢ͷ͕؊ཁ wؔ࿈ΤϯςΟςΟ ྫregistrations wʮॲཧʯΛද͢Ϧιʔε ྫimports
ه