CodeNewbie Community 🌱

Discussion on: How do Ruby on Rails "strong parameters" work?

Collapse
 
rhymes profile image
rhymes • Edited

Hi @alton_674 , Rails magic sometimes is indeed too much "magic".

So called "Strong parameters" amount to a mechanism to avoid a technique called mass assignment. Since it's common to do things like:

model.update(params)
Enter fullscreen mode Exit fullscreen mode

by requiring that the developer enumerates which parameters are "safe" for assignment, you can block the client from overriding important data in your model that you didn't intend to change.

Can I ask you more details about the bug you're encountering? You say the controller is throwing an error, which error?

Thank you!