Published on October 2, 2007
a myftical journey through the Request Cycle of RUBY ON RAILS. AN ORATION IN TWO PARTS L.C. BY
ocol adap prot ter dispatcher controller view
principle info passed via arguments via objects return value ignored
protocol adapter dispatcher controller view
The Dispatcher: just a class™
dispatch(cgi, session_options, output) Dispatcher
fastcgi webrick mongrel cgi.rb Dispatcher
classic CGI supported
classic CGI supported Who cares?
Finesse arguments. Find Controller. Delegate to Controller. Handle errors. Tidy up.
Finesse arguments. request response cgi.rb cgi.rb
Find Controller. ROUTING populates request
Delegate to Controller. controller_class.process(request,response)
Handle errors. begin dispatcher controller view bo om ! rescue Exception => exception end
Handle errors. rescue Exception => exception controller_class.process_with_exception (request,response,exception) end end
Handle errors. rescue Exception => exception failsafe_response(output, '500 Internal Server Error', exception) do controller_class.process_with_exception (request,response,exception) end end
Tidy up. production # no-op
Tidy up. production # no-op otherwise framework tidy-up hooks Dependencies ActiveRecord
response headers body
Your controller: just an object™
process(request,response,method, *args) ActionController
Setup instance. Dispatch action. Render. Finesse response. Tidy up.
Setup instance. Set up the magic to make your actions sing!
Setup instance. Housekeeping
Setup instance. handy accessors from request: from response: response request params template cookies session headers
Dispatch action. instance method (and, render if you haven't).
Dispatch action. -or- method missing (and, render if you haven't).
Dispatch action. -or- just render.
Render. @assigns = instance_vars - protected_vars
Finesse response. text/html Tidy up. close session
Where are filters?
Where are filters? mixin!
Where are filters? mixin! helpers?
Where are filters? mixin! helpers? mixin!
principle Solid basics + Fancy stuff.
5 minute talk subject: How we choose your view for you.
json nothing xml ml ht How we choose ac ti on your view rjs for you. et la mp la yo te ut ile f text
Come with me on a journey through the internals of Rails, as we trace a request from the web server to the controller action method, and follow the ...
Guide for navigating a Rails app with a form. When developing a Rails app, the request/response cycle is a useful guide to trace how a user's request flows ...
When developing a Rails app, the request/response cycle is a useful guide to see how all the app's files and folders fit together. The request/response ...
i'm a novice in ruby on rails trying to understand the indepth flow of a typical request/ response life cycle in ruby on rails web application. i have ...
How Rails Works: The Rails Request Cycle. Ruby is a wonderful programming language. So much power, so much potential, so little syntax. I cannot imagine a ...
The Rails Request Cycle. Let me tell you about something exciting!: THE RAILS CYCLE! First, Rails matches route on route. The Router is basically just a ...
Action Controller Overview. In this guide you will learn how controllers work and how they fit into the request cycle in your application. After reading ...
Getting Started with Rails. This guide covers getting up and running with Ruby on Rails. After reading this guide, you will know: How to install Rails ...