Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
69
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
42
UW Advanced Rails Week 8
benwoodall
0
49
UW Advanced Rails Week 7
benwoodall
0
46
Week 6
benwoodall
0
47
UW Advanced Rails Week 5
benwoodall
0
56
UW Advanced Rails Week 3
benwoodall
0
68
UW Advanced Rails Week 2
benwoodall
0
180
UW Advanced Rails Week 1
benwoodall
0
98
A Bit More Git
benwoodall
1
5.1k
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
230
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
130
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.1k
マスタデータ問題、マイクロサービスでどう解くか
kts
0
130
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
190
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
270
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
390
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
190
Python札幌 LT資料
t3tra
7
1.1k
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
クラウドに依存しないS3を使った開発術
simesaba80
0
170
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Docker and Python
trallard
47
3.7k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
32
From π to Pie charts
rasagy
0
92
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
115
94k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
KATA
mclloyd
PRO
33
15k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
First, design no harm
axbom
PRO
1
1.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Designing for Timeless Needs
cassininazir
0
93
WCS-LA-2024
lcolladotor
0
390
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