I'm a novice in ruby on rails trying to understand the in-depth flow of a typical request/response life cycle in ruby on rails web application.
I have googled for the info and have not found an answer which is complete or detailed to the level of DNS servers to dispatchers.
The closest I got to a good explanation is at: http://brainspl.at/request_response.pdf.
Can someone point me to a better or more detailed explanation?
-Raviteja
So you are asking for rails request/response cycle and you already referred to a presentation which really describes it very well. So im assuming that you want to know it from a very high level and you need this concept totally for development. Then here it is. Im just trying to name the parts sequentially.
params
hash.before_filter
. If found anything then those functions will be called first.before_filter
methods in a particular sequence, it will call the actual method. All the data is available in params
hash in this method. It processes input data, invokes Model calls for database access, and prepare data for view.render :partial
call. And the response will be prepared using the variables prepared in controller. This response will go to the client.after_filter
methods and will those if found.Well this was a quick overview i would say, without really any details. Im saying again, the pdf you referred really contains more details.
Let me know if you want to know anything more specifically.
A user opens his browser, types in a URL, and presses Enter. When a user presses Enter, the browser makes a request for that URL. The request hits the Rails router (config/routes.rb). The router maps the URL to the correct controller and action to handle the request. The action receives the request, and asks the model to fetch data from the database. The model returns a list of data to the controller action. The controller action passes the data on to the view. The view renders the page as HTML. The controller sends the HTML back to the browser. The page loads and the user sees it.
https://www.codecademy.com/articles/request-response-cycle-dynamic and https://www.codecademy.com/articles/request-response-cycle-forms
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With