Rails Request Handling Process

When the user is trying to access one Rails application, for e.g, http://www.xyz.com/abc/display/123. Note that “abc” is the controller, “display” is the action and “123” is the id.

1. Browser (Web Client)

  • Pass URL to server

2. Web server:

  • finds “abc” application directory, and consults .htaccess file

3. .htaccess

  • triggers execution of dispatch.fcgi (or other dispatcher, if specified)

4. dispatch.fcgi

  • loads dispatcher library and triggers execution of application code based on controller and action fields of URL

5. app/controllers/abc_controller.rb

  • execute its “display” method, with “id” CGI variable set to “123”; the corresponding view template filled out

6. app/views/abc/display.rhtml

  • ERb template, filled out to become a complete HTML document; that document is then sent to the server

7. Web server

  • Returns final HTML document to browser

8. Browser (Web Client)

  • Gets back HTML and renders it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: