Encountered while creating DM function Entry is a table for managing users who enter the chat room Room is an intermediate table for chatting
Indicates that param does not exist in entry or the value of param is empty.
(1) Delete the require method of the strong parameter (2) Only the permit method is described
When submitting data from a form There is a security issue called "mass assignment vulnerability". For example, if an unauthorized request is made at the timing of data transmission, The data may differ from what is expected.
➡︎ A mechanism to prevent this vulnerability. By specifying the column name that allows registration and update in advance for each method, If unauthorized column data is sent, it will be discriminated and excluded from registration and update actions.
Extract only the value associated with a specific key in params. You must specify the key name of the value you want to retrieve in the argument.
Get only the values of the allowed columns. The column name for that must be specified in the argument. If an unauthorized column exists in params, the column data will be treated as unacquired and ignored.
Join hashes (arrays with keys and values). For example, if there is a value that is not included in the received params but you want to include it together.
Limit the invocation of each method. Therefore, it can be prevented from being recognized as an action by the controller.
It looks like the require method wasn't working. I wanted to call the data stored in the Entry table in the Room controller, When I specified it with the require method, it didn't work for some reason. Was it perceived as a duplicate?
https://stackoverflow.com/questions/47391168/param-is-missing-or-the-value-is-empty-in-nested-resource-method https://railsguides.jp/action_controller_overview.html#strong-parameters https://qiita.com/kazuki13070311/items/cdd4917af204e00de001 https://qiita.com/takuyama/items/d0f1aa073a8e2e7212f2 https://qiita.com/Takka_Log/items/32dae78d7e3892e7b051 https://qiita.com/ozackiee/items/f100fd51f4839b3fdca8 https://qiita.com/akiupdate/items/514b107090c16a2e1b47 https://qiita.com/zenfumi/items/694edc863527f91c8976
Recommended Posts