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
UW Advanced Rails Week 4
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ben Woodall
April 23, 2015
Programming
74
0
Share
UW Advanced Rails Week 4
Ben Woodall
April 23, 2015
More Decks by Ben Woodall
See All by Ben Woodall
UW Advanced Rails Week 9
benwoodall
0
47
UW Advanced Rails Week 8
benwoodall
0
54
UW Advanced Rails Week 7
benwoodall
0
51
Week 6
benwoodall
0
54
UW Advanced Rails Week 5
benwoodall
0
61
UW Advanced Rails Week 3
benwoodall
0
74
UW Advanced Rails Week 2
benwoodall
0
200
UW Advanced Rails Week 1
benwoodall
0
100
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
なぜあなたのコードには「コシ」がないのか?〜AI時代に問う、最後まで美味しい設計と戦略〜 #phpconkagawa / phpconkagawa2026
shogogg
0
140
GitHubCopilotCLIをはじめよう.pdf
htkym
0
320
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
330
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
Vibe NLP for Applied NLP
inesmontani
PRO
0
610
【26新卒研修】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
140
20260514_its_the_context_window_stupid.pdf
heita
0
440
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
310
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.8k
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
190
Firefoxにコントリビューションして得られた学び
ken7253
2
150
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
220
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
The Spectacular Lies of Maps
axbom
PRO
1
730
Are puppies a ranking factor?
jonoalderson
1
3.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
New Earth Scene 8
popppiees
3
2.2k
Raft: Consensus for Rubyists
vanstee
141
7.4k
How to build a perfect <img>
jonoalderson
1
5.5k
Designing Powerful Visuals for Engaging Learning
tmiket
1
360
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
We Have a Design System, Now What?
morganepeng
55
8.1k
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
Transcript
Questions from Week 3? 1
Week 4: Building APIs Spring 2015 2
Why an API? Allow other applications to interface with our
services Useful for data driven development 3
REST API Data Formats JSON JavaScript Object Notation MIME type:
application/json XML Extensible Markup Language MIME type: application/xml and text/xml 4
JSON Example { "shorturl": "lf64kr", "user": { "id": 2, "name":
"benwoodall", "email": "
[email protected]
" }, "array": [1,3,5,7] } 5
XML Example <?xml version="1.0" encoding="UTF-8" ?> <root> <shorturl>lf64kr</shorturl> <user> <id>2</id>
<name>benwoodall</name> <email>
[email protected]
</email> </user> <array>1</array> <array>3</array> <array>5</array> <array>7</array> </root> 6
Building an API in Shortener 7
We need an API end-point to create short urls Requests
should be authenticated against 8 What do we know so far?
Tests 9 spec/controllers/api/v1/links_controller_spec.rb
respond_to 10
respond_to 11
Namespacing 12 config/routes.rb
Namespacing 13 config/routes.rb app/controllers/api/base_controller.rb
Namespacing 14 config/routes.rb app/controllers/api/base_controller.rb app/controllers/api/v1/links_controller.rb
Testing 15 spec/controllers/api/v1/links_controller_spec.rb
Creating a Link 16 app/controllers/api/v1/links_controller.rb
Authenticating 17 app/controllers/api/base_controller.rb
Authenticating 18
Authenticating 19
Authenticating 20 app/models/user.rb
Views 21 app/views/settings/index.html.erb
JBuilder 22 app/views/api/v1/links/show.html.erb
Questions? 23