What code runs when you request a page from a Ruby on Rails application?
Here is an annotated trace showing every method call within Rails and its dependencies. It is for an example application that loads a blog post from the database and renders a page containing the post's title.
After we render the view and all of our Rack middlewares have finished running, Puma can send the page we've generated back to the client. Here it's using the
fast_write method to send data to the open socket.
After the response is sent, Rails performs some cleanup of caches and releases any database connections.