Join Kevin Skoglund for an in-depth discussion in this video Create action: New, part of Ruby on Rails 3 Essential Training.
Now that we understand the basics of working with forms, we are ready to…implement the create actions in our controller.…You will remember that the create part of CRUD is made up of two standard Rails…actions, new and create, and they work in conjunction with each other.…New displays a web form that we can then click Submit, and Submit will submit…the form to the create action, to take care of the processing.…Let's focus on the first half of that in this movie, the new action.…Let's start by adding our form template.…So inside the views, inside subjects, I am just going to add a new one.…It's going to be new.html.erb.…
Now the form that I am going to use is exactly the same form that we saw in the…last movie. We are using it as an example.…I'm using form_for, the subject, passing in the url as action create.…So we are a going to submit this to create action and the variable f here will…be equal to subject as we go through the rest of the form.…So for the subject give me a text_field for the name. On the subject give me a…
- 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.