From the course: Ruby on Rails 6 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Generate a controller and view

Generate a controller and view - Ruby on Rails Tutorial

From the course: Ruby on Rails 6 Essential Training

Start my 1-month free trial

Generate a controller and view

- [Instructor] We will begin customizing our Rails application by learning how to generate a controller and a view. Remember the MVC diagram that we saw earlier? The browser contacts the controller. The controller makes choices and decides how to proceed. It may contact the model, which may be attached to a database, to retrieve data. And once it's assembled everything it needs, then it's going to go to the view to render a template to return back to the browser. I want you to notice that the right part of that diagram, the model and the database, is optional. Some requests may not use them. The browser can contact the controller which then can immediately render a view back to the browser. That left hand triangle though, is essential. It must happen with each request. That's where we're going to focus for now. And we'll learn to work with models later. Let's see how we can create the controller and view. We're going to…

Contents