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 - Ruby on Rails Tutorial
From the course: Ruby on Rails 6 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
Read action: Index4m 20s
-
Read action: Show4m
-
Adding basic forms to templates4m 51s
-
Create action: New4m 12s
-
Create action: Create5m 5s
-
Using strong parameters to regulate input4m 57s
-
Update actions: Edit and update6m 19s
-
Using partials and helpers to organize code6m 36s
-
Delete actions: Delete and destroy5m 50s
-
Challenge: Pages CRUD1m 23s
-
Solution: Pages CRUD4m 50s
-
-