Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Your Rails App is talking to you. Are you listening? by Nadja Lederer

Your Rails App is talking to you. Are you listening? by Nadja Lederer

presentation during Rails Girls St. Pölten: Your Rails App is talking to you. Are you listening? by the Coach Nadja Lederer

Your Rails App is talking to you. Are you listening? (http standard response codes and sample error pages)

Transcript

  1. [1]

  2. Your Rails App is talking to you… Are you listening?

    Nadja Lederer Rails Girls St. Pölten, 29.3.2014
  3. 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]
  4. 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
  5. How does it work? [3]

  6. How does it work?

  7. How does it work? HTTP sends a question

  8. How does it work? HTTP sends a question HTTP sends

    an answer
  9. What do I see in the browser?

  10. Status codes 200 OK | 404 Not Found | 301

    Moved Permanently
  11. HTTP Status Code Classes ¤  1xx . . . Informational

    ¤  2xx . . . Success ¤  3xx . . . Redirection ¤  4xx . . . Client Error ¤  5xx . . . Server Error [4]
  12. [5]

  13. [6]

  14. Where’s my 404 – you ask? Let’s have a look

    at your Rails App…
  15. Error pages reside in the ./public directory of your app

    Customized content ;)
  16. None
  17. Custom 404’s They can be so much fun…

  18. [7]

  19. [8]

  20. [9]

  21. Take away

  22. 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 ;)
  23. [10]

  24. 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