From the course: Ruby on Rails 5 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 5 Essential Training

Start my 1-month free trial

Generate a controller and view

- [Instructor] We've now seen how to create and access a Rails project, but at the moment, it's just a bunch of default code. We want to customize the application for our needs, and we're going to start the process by learning how to generate a controller and a view. Think back to the MVC architecture diagram that we sell earlier. We have a browser that sends a request to our controller code, and the controller then makes whatever decisions it needs, accesses the model and the database if it needs to, and then finally, when it's ready, sends its data on to the view, which constructs the presentation, and that's sent back to the browser as a webpage. The model and the database portion is really optional. The browser and the controller interview portion is the key triangle that must happen with each request. It's the minimum amount that a Rails application needs. The browser communicates with the controller, the controller goes to the view, the view goes back to the browser. We're going…

Contents