Join Kevin Skoglund for an in-depth discussion in this video Updating records, part of Ruby on Rails 3 Essential Training.
- View Offline
- Exercise Files
In the last movie, we saw how to use the console to create new records and save…them to the database.…Now, I want to look at how we can update those records that are in the database.…Once again, there are two ways we can do it.…The first is that we will find the record that we are looking for, set its…values, and then save the record.…Very similar what we did with new before.…The second is more analogous to what we did with create where we are going…to find the record and then all-in-one step, we are going to set its values and save it.…The method name we'll use to do that is called update_attributes.…
Let's go to our console.…In my command line, you can see I've already navigated to my rails project and…have already launched the console.…The first thing we need to do is find one of these records that we just created…and saved to the database.…There are lot of ways that we can find records in Rails and we'll be covering…those in a later movie.…For now I just want to stick to the most basic one which is defined it by its ID.…
- 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.