How tcs/rails works
This is Ruby on Rails, a web-application framework centered on database-backed MVC applications. The principal workflow accepts an HTTP request, routes it to a controller, manipulates model objects through Active Record, and renders a view or response. Major supporting capabilities include routing, middleware, model validation, database adapters, remote REST resources, mail delivery, and application/engine configuration. The README documents the MVC package boundaries; sampled excerpts show scaffold controller behavior and engine route registration. Other links are omitted where the supplied evidence does not establish a call path.
Main entry points: metal.rb Controller actions · base.rb Active Record ORM · routing.rb Route set · request.rb HTTP dispatch
Components 19
Request runtime
- Route set
actionpack/lib/action_dispatch/routing.rb - HTTP dispatch
actionpack/lib/action_dispatch/http/request.rb - Controller actions
actionpack/lib/action_controller/metal.rb - View rendering
actionpack/lib/action_view/renderer/template_renderer.rb - HTTP response
actionpack/lib/action_dispatch/http/response.rb - Middleware stack
actionpack/lib/action_dispatch/middleware/stack.rb
Models and data
- Active Record ORM
activerecord/lib/active_record/base.rb - Query relations
activerecord/lib/active_record/relation/query_methods.rb - Database statements
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb - Relational database
- Model features
activemodel/lib/active_model/attribute_methods.rb
Framework capabilities
- REST resources
activeresource/lib/active_resource/base.rb - Mail delivery
actionmailer/lib/action_mailer/base.rb - Caching
actionpack/lib/action_controller/caching.rb - Shared utilities
activesupport/lib/active_support/dependencies.rb
Application platform
- Rails engines
railties/lib/rails/engine.rb - Route reloader
railties/lib/rails/application/routes_reloader.rb - Scaffold controller
railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
Other components
- Web user
Connections 18
- Web user → Route set: sends request
- Route set → HTTP dispatch: dispatches request
- HTTP dispatch → Controller actions: invokes action
- Controller actions → Active Record ORM: manipulates models
- Controller actions → View rendering: directs data
- Controller actions → HTTP response: returns response
- Middleware stack → HTTP dispatch: wraps requests
- Active Record ORM → Query relations: builds relations
- Query relations → Database statements: executes queries
- Database statements → Relational database: reads and writes
- Model features → Active Record ORM: supplies model behavior
- REST resources → Web user: accesses remote APIs
- Mail delivery → Web user: delivers messages
- Rails engines → Route reloader: registers route sets
railties/lib/rails/engine.rb - Route reloader → Route set: finalizes routes
- Scaffold controller → Active Record ORM: calls ORM
railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb - Scaffold controller → View rendering: renders templates
railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb - Shared utilities → Rails engines: supports loading