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.
Created by Chris Zetter in a tribute to Rails and its many contributors.
Read out more about how the trace was made.
You can see the code that powers this page and suggest resources to link to on GitHub.