From the course: Ruby on Rails 6 Essential Training

Unlock the full course today

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

Solution: Pages CRUD

Solution: Pages CRUD - Ruby on Rails Tutorial

From the course: Ruby on Rails 6 Essential Training

Start my 1-month free trial

Solution: Pages CRUD

(soothing electronic music) - [Instructor] Hopefully you had success with this challenge assignment. In this movie, I'll show you the solution that I came up with. The first thing that I did was I went to the routes file, because that's where everything starts in our Rails application. Requests come in and we have to be able to route them correctly. I had a resourceful route already set for pages and it included a member route for delete. So that has everything that I need so I knew I was in good shape. The next thing I did was I went to the PagesController and I had place holders for all the actions but I needed to fill them out with the actual code that each action would perform. So I went through them one at a time. For index, I knew that I needed to come up with a list of pages that we could display as a list. For show I needed to find a particular page based on the ID that was passed in, in params. For…

Contents