Learn to implement a basic “new” action by writing controller code and the related HTML for the view template. The new action is a Read operation which displays an HTML form for preparing to edit a database record.
- [Voiceover] Now that we understand…the basics of forms, we're ready to implement…the Create Actions in our controller.…The create part of CRUD is made up of two standard actions,…New and Create, and they work together.…The New action displays a web form…that we can fill out and submit to the Create action.…Create action handles the form processing.…Let's focus on the New action in this movie.…Let's begin by adding a link from the Index template…to our New action.…You can see, I already have the link here…for Add New Subject.…Let's go and actually add the code that we need…to make that work.…
Inside my Index template, here's my Add New Subject,…and right now, I just have a placeholder.…Now we could just write out the URL for that.…It's subjects slash new.…That's the restful route that we created for this.…But it's better if we can use the route helper,…the resourceful route helper…that we talked about at the end of the last chapter.…So what that would be here is new underscore subject…underscore path.…And that reads well too.…
- Creating and configuring a new Ruby on Rails project
- Generating controllers and views
- Handling server requests
- Using different types of routes
- Rendering and viewing templates
- Generating migrations and models
- Creating, updating, and deleting records
- Finding records with queries
- Understanding relationship types
- Writing controllers for CRUD
- Working with layouts and helpers
- Managing application assets
- Building forms
- Validating data
- Authenticating users
Skill Level Beginner
1. What Is Ruby on Rails?
2. Get Started
3. Controllers, Views, and Dynamic Content
4. Databases and Migrations
5. Models and ActiveRecord
7. CRUD, REST, and Resourceful Routes
8. Controllers and CRUD
9. Layouts, Partials, and View Helpers
12. Data Validation
13. Controller Features
14. User Authentication
15. Improve the Simple CMS
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.