Skip to content

For a truly in-depth understanding of how Rails works, I built a "lite" version of it from scratch.

Notifications You must be signed in to change notification settings

rrzein/RailsLite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

For a truly in-depth understanding of how Rails works, I built a "lite" version of it from scratch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages