Slide 1

Slide 1 text

[1]

Slide 2

Slide 2 text

Your Rails App is talking to you… Are you listening? Nadja Lederer Rails Girls St. Pölten, 29.3.2014

Slide 3

Slide 3 text

HTTP = Hypertext Transfer Protocol ¤  protocol used by the World Wide Web ¤  defines what a message looks like, and how a web server or browser responds to it [2]

Slide 4

Slide 4 text

HTTP = Hypertext Transfer Protocol ¤  protocol used by the World Wide Web HTTP world Real-life situations GET get more information about sth POST create something, take a pic, write a book, code your rails app ;) PUT / PATCH get yourself a new styling, pimp your car DELETE burger / veggie place, order sth and eat it all up

Slide 5

Slide 5 text

How does it work? [3]

Slide 6

Slide 6 text

How does it work?

Slide 7

Slide 7 text

How does it work? HTTP sends a question

Slide 8

Slide 8 text

How does it work? HTTP sends a question HTTP sends an answer

Slide 9

Slide 9 text

What do I see in the browser?

Slide 10

Slide 10 text

Status codes 200 OK | 404 Not Found | 301 Moved Permanently

Slide 11

Slide 11 text

HTTP Status Code Classes ¤  1xx . . . Informational ¤  2xx . . . Success ¤  3xx . . . Redirection ¤  4xx . . . Client Error ¤  5xx . . . Server Error [4]

Slide 12

Slide 12 text

[5]

Slide 13

Slide 13 text

[6]

Slide 14

Slide 14 text

Where’s my 404 – you ask? Let’s have a look at your Rails App…

Slide 15

Slide 15 text

Error pages reside in the ./public directory of your app Customized content ;)

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Custom 404’s They can be so much fun…

Slide 18

Slide 18 text

[7]

Slide 19

Slide 19 text

[8]

Slide 20

Slide 20 text

[9]

Slide 21

Slide 21 text

Take away

Slide 22

Slide 22 text

Take away ¤  GET, POST, PUT / PATCH, DELETE ¤  HTTP question & answer always come in pairs ¤  HTTP answer carries a status code ¤  Status codes tell about success / failure (and reason) ¤  Every Rails App has error pages in ./public directory ¤  Have fun customizing them ;)

Slide 23

Slide 23 text

[10]

Slide 24

Slide 24 text

Picture References [1] http://fab404.com/wp-content/uploads/2009/03/frye-wiles404.jpg [2] http://www.officeassist.ca/images/j0309261.jpg [3] http://symfony.com/doc/current/_images/http-xkcd.png [4] http://media-cache-ak0.pinimg.com/236x/ff/e2/2b/ffe22b2e7c226d79a6876281ed25a340.jpg [5] http://www.flickr.com/photos/girliemac/6508022985/in/photostream/ [6] http://httpstatusdogs.com/301-moved-permanently [7] http://cdn6.blackhillswebworks.com/wp-content/uploads/2010/02/404page.jpg [8] http://www.evohosting.co.uk/wp-content/uploads/2011/07/freeassociation.png [9] http://blog.ifabbo.com/wp-content/uploads/404error.png [10] http://webdesignledger.com/wp-content/uploads/2009/10/404/25.jpg