The params
used in def create
in the rails project is the singular name_params of the controller. Is this the rails specification?
I'm worried that I can't find such a configuration file.
Could you please tell me the details?
I would appreciate it if you could let me know if there is any other missing information.
Thank you for your cooperation.
I think it's probably a controller generated by scaffold, but the singular_params of the controller is a method called the strong parameter, which is defined as the
private
method in the controller's file.
prevate
def hoge_params
param.require(:model name).permit(:column 1,:column 2)
end
For example, in the above case, any parameters other than Column 1 and Column 2 specified in permit
are ignored when POSTed.
The strong parameter is a feature introduced in rails4 and later to combat vulnerabilities such as mass assignment to prevent malicious parameter manipulation.
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.