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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ben Woodall
April 23, 2015
Programming
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
51
UW Advanced Rails Week 8
benwoodall
0
62
UW Advanced Rails Week 7
benwoodall
0
58
Week 6
benwoodall
0
65
UW Advanced Rails Week 5
benwoodall
0
71
UW Advanced Rails Week 3
benwoodall
0
80
UW Advanced Rails Week 2
benwoodall
0
220
UW Advanced Rails Week 1
benwoodall
0
110
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
Claude Team Plan導入・ガイド
tk3fftk
0
250
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
3.4k
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.8k
What's New in Android 2026
veronikapj
0
240
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.3k
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
290
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
110
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
220
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
150
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
240
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
210
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Automating Front-end Workflow
addyosmani
1370
210k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
270
Why Our Code Smells
bkeepers
PRO
340
58k
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
RailsConf 2023
tenderlove
30
1.5k
GitHub's CSS Performance
jonrohan
1033
470k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
520
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
340
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