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
Ben Woodall
April 23, 2015
Programming
0
71
UW Advanced Rails Week 4
Ben Woodall
April 23, 2015
Tweet
Share
More Decks by Ben Woodall
See All by Ben Woodall
UW Advanced Rails Week 9
benwoodall
0
44
UW Advanced Rails Week 8
benwoodall
0
51
UW Advanced Rails Week 7
benwoodall
0
47
Week 6
benwoodall
0
51
UW Advanced Rails Week 5
benwoodall
0
57
UW Advanced Rails Week 3
benwoodall
0
70
UW Advanced Rails Week 2
benwoodall
0
190
UW Advanced Rails Week 1
benwoodall
0
100
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
350
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
Python’s True Superpower
hynek
0
200
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
240
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
430
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
150
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
220
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
340
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
650
TipKitTips
ktcryomm
0
150
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
690
CSC307 Lecture 11
javiergs
PRO
0
590
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
980
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.8k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
Chasing Engaging Ingredients in Design
codingconduct
0
130
Building Adaptive Systems
keathley
44
2.9k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
60
51k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
From π to Pie charts
rasagy
0
150
Six Lessons from altMBA
skipperchong
29
4.2k
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
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