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
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
56
UW Advanced Rails Week 3
benwoodall
0
70
UW Advanced Rails Week 2
benwoodall
0
190
UW Advanced Rails Week 1
benwoodall
0
99
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
150
SourceGeneratorのススメ
htkym
0
200
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
210
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
150
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
CSC307 Lecture 05
javiergs
PRO
0
500
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
990
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
750
今から始めるClaude Code超入門
448jp
8
9.1k
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
6
680
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
240
Raku Raku Notion 20260128
hareyakayuruyaka
0
370
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Chasing Engaging Ingredients in Design
codingconduct
0
120
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
330
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Building Adaptive Systems
keathley
44
2.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
760
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
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