Streamlining the curriculum.
Goal of this lesson is to understand what middlewares in Rack are good for.
Start with these articles:
You should be able to answer the following questions:
before_filter
in ApplicationController
?Now look at the middleware stack of a freshly installed Rails application Show archive.org snapshot . For each middleware in the stack:
We are using the exception_notification
gem to receive an e-mail whenever one of our apps raises an unhandled exception.
Look through the repo Show archive.org snapshot and understand how it does this (hint: it’s a middleware!).
GET /hello
when added to the middleware stack. The path would simply print HI WORLD
with a text/plain
content type.OUCH
to the screen whenever the Rails application raises an unhandled error.