From the course: Ruby on Rails 6 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using strong parameters to regulate input

Using strong parameters to regulate input - Ruby on Rails Tutorial

From the course: Ruby on Rails 6 Essential Training

Start my 1-month free trial

Using strong parameters to regulate input

- [Instructor] In the last movie, we tried to submit a web form to have it processed by our create action, but we got back an error. That's okay, because the error that we ran into was actually a Rails security feature. That's very useful, but we need to learn how to use it. And to do that, we have to learn about mass assignment and strong parameters. Mass assignment is the term for passing a hash of values, usually from form parameters to an object that's going to be assigned to the object's attributes. New, create, and update are the primary methods that use mass assignment, but there are a few others as well. In each one of these cases, you'll see that we're taking a hash of values, and we're essentially just dumping them into the object and asking the object to assign all of the attributes based on that hash. That's what mass assignment is. Rails is making our lives much easier by allowing us to assign values to this…

Contents