Skip to content
For a truly in-depth understanding of how Rails works, I built a "lite" version of it from scratch.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
views
.DS_Store
README.md

README.md

Rails Lite

Rails isn't magic, but sometimes it feels like it. To get a better understanding of Rails' MVC web framework, I built a "lite" version of Rails from scratch.

Below are some noteworthy facets of this project:

  • WEBRick Server: server.rb The server utilizes Ruby's WEBRick library to provide the interface for receiving HTTP requests and sending responses.

  • ControllerBase: controller_base.rb ControllerBase takes in HTTPRequest objects to fill out an HTTPResponse object. It sets the content_type and body of the response and returns the response with rendered content.

  • Session session.rb Session allows us to set and store HTTPCookies for the user's session.

  • Params params.rb Params allows us to receive and parse params from either the router's match of the URL, the query string, or the request body.

  • Router router.rb Router keeps track of multiple routes, including the matched URL patterns, the HTTP method (GET, POST, PUT, DELETE), the controller class the route maps to, and the action to be invoked.

You can’t perform that action at this time.