Your SlideShare is downloading. ×

The Rails Request Cycle

7,222

Published on

A journey through the Rails request cycle. It might be a bit hard to follow w/o the talk to go along with it. …

A journey through the Rails request cycle. It might be a bit hard to follow w/o the talk to go along with it.

From January 2007

Published in: Technology
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,222
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
60
Comments
0
Likes
8
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. a myftical journey through the Request Cycle of RUBY ON RAILS. AN ORATION IN TWO PARTS L.C. BY
  • 2. PART ZERO
  • 3. ocol adap prot ter dispatcher controller view
  • 4. principle info passed via arguments via objects return value ignored
  • 5. protocol adapter dispatcher controller view
  • 6. principle
  • 7. PART ONE
  • 8. The Dispatcher:
  • 9. The Dispatcher: just a class™
  • 10. dispatch(cgi, session_options, output) Dispatcher
  • 11. fastcgi webrick mongrel cgi.rb Dispatcher
  • 12. classic CGI
  • 13. classic CGI supported
  • 14. classic CGI supported Who cares?
  • 15. Finesse arguments. Find Controller. Delegate to Controller. Handle errors. Tidy up.
  • 16. Finesse arguments. request response cgi.rb cgi.rb
  • 17. Find Controller. ROUTING populates request
  • 18. Delegate to Controller. controller_class.process(request,response)
  • 19. Handle errors. begin dispatcher controller view bo om ! rescue Exception => exception end
  • 20. Handle errors. rescue Exception => exception controller_class.process_with_exception (request,response,exception) end end
  • 21. Handle errors. rescue Exception => exception failsafe_response(output, '500 Internal Server Error', exception) do controller_class.process_with_exception (request,response,exception) end end
  • 22. Tidy up. production # no-op
  • 23. Tidy up. production # no-op otherwise framework tidy-up hooks Dependencies ActiveRecord
  • 24. response headers body
  • 25. PART TWO
  • 26. Your controller:
  • 27. Your controller: just an object™
  • 28. process(request,response,method, *args) ActionController
  • 29. Setup instance. Dispatch action. Render. Finesse response. Tidy up.
  • 30. Setup instance. Set up the magic to make your actions sing!
  • 31. Setup instance. Housekeeping
  • 32. Setup instance. handy accessors from request: from response: response request params template cookies session headers
  • 33. Dispatch action. instance method (and, render if you haven't).
  • 34. Dispatch action. -or- method missing (and, render if you haven't).
  • 35. Dispatch action. -or- just render.
  • 36. Render. VIEWY
  • 37. Render. @assigns = instance_vars - protected_vars
  • 38. Finesse response. text/html Tidy up. close session
  • 39. Where are
  • 40. Where are filters?
  • 41. Where are filters? mixin!
  • 42. Where are filters? mixin! helpers?
  • 43. Where are filters? mixin! helpers? mixin!
  • 44. principle Solid basics + Fancy stuff.
  • 45. 5 minute talk subject: How we choose your view for you.
  • 46. 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
  • 47. THE END

×