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
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
170
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
120
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.4k
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
290
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
310
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.6k
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.7k
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
210
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.5k
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
930
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Site-Speed That Sticks
csswizardry
13
1.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
How to train your dragon (web standard)
notwaldorf
97
6.5k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Raft: Consensus for Rubyists
vanstee
141
7.3k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
360
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Curious Case for Waylosing
cassininazir
0
260
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Ethics towards AI in product and experience design
skipperchong
2
210
The SEO Collaboration Effect
kristinabergwall1
0
380
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