Join Kevin Skoglund for an in-depth discussion in this video Scoping the sort positions, part of Ruby on Rails 3 Essential Training.
- View Offline
- Exercise Files
In this movie, we'll consider the positions that determine the sort order of our…subjects, pages, and sections.…A problem area has become apparent here now that there are pages are nested…inside are subjects.…The position choices for a page are not limited to just the positions under that one subject.…If we have a subject with three pages total, then we ought to only have…positions 1, 2 and 3 available to us in our form values, but instead, we get 1…to the total number of pages.…What we need is to narrow the scope of the positioning for our page the same way…that we narrow the scope of the pages that get listed in the list action.…
So, let's make that change and then while we are in there…let's also add a named scope that's going to make it easy for us to sort…subjects, pages, and sections by their position.…So, the issue of position, if we go into the controllers, if we go under…subjects, we look at new, this is fine.…The subject_count, the total number of subjects that we have available, should be…
- Understanding MVC (Model View Controller ) architecture
- Routing browser requests through the framework
- Responding to requests with dynamic content
- Defining associations and database relationships
- Creating, reading, updating and deleting records
- Working with forms
- Validating form data
- Reviewing built-in security features
- Authenticating users and managing user access
- Debugging and error handling
Skill Level Beginner
1. What Is Ruby on Rails?
2. Installing Ruby on Rails on a Mac
3. Installing Ruby on Rails on a Windows Machine
4. Getting Started
5. Controllers, Views, and Dynamic Content
6. Databases and Migrations
7. Models, ActiveRecord, and ActiveRelation
9. Controllers and CRUD
10. Layouts, Partials, and View Helpers
12. Data Validation
13. User Authentication
14. Improving the Simple CMS
15. Debugging and Error Handling
16. Introducing More Advanced Topics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.