Frontend
Updated Aug 24, 2023 ·
Overview
info
This page builds on the articles table created in the CRUD Operations page.
The complete config files can be found here: Github/test-rails-app
This page focuses on showing one article on the front end, which means handling the read part of CRUD in the browser.
When a user visits a URL like /articles/1, Rails processes it step by step.
- The URL contains the article ID.
- The request is received by the
routes.rbfile. - The route maps the request to the controller's
showaction - The controller uses the
Articlemodel to interact with the database. - The model queries the database and retrieves the article.
- The model sends back the article to the
showaction. - The controller uses the
showview. - The view is displayed on the browser.
At the end of this flow, the view has access to the article data and can render it on the browser.
