Request Cycle for Ruby on Railss
The Rails request cycle is the path a web request takes through the framework: the router matches a URL to a controller action, the controller loads data and decides what to render, and a view built with ERB and helpers produces the response. Understanding this flow explains where each piece of Rails code belongs.
Stage: Rails Core · Part of the Ruby on Rails roadmap · Last reviewed 19 November 2026
What to learn in Request Cycle
- Declare resourceful routes and read them with bin/rails routes
- Write a controller action that loads a record and renders a view
- Read request data through params and strong parameters
- Build views with ERB, partials and layouts
- Use form_with and link_to helpers to generate HTML
Request Cycle interview questions
What do strong parameters protect against?
They stop mass assignment attacks, where a user submits extra fields such as admin=true that get written to a model. In the controller you call params.require(:post).permit(:title, :body) so only listed attributes are accepted.
What does resources :articles generate in routes?
It creates the standard seven RESTful routes: index, show, new, create, edit, update and destroy, mapped to matching controller actions and HTTP verbs, along with URL helpers like articles_path. It keeps routes consistent without writing each by hand.
Where Request Cycle fits in the Ruby on Rails roadmap
Request Cycle belongs to the Rails Core stage (beginner level), which takes about 25 hours. MVC.
Other units in this stage
Back to the full Ruby on Rails roadmap