- No need to manually call
#symbolize_keys
. rails does this for you. you can use nested attributes in StrongParams this way
params.require(:model_name_here).permit(:attribute1, :attribute2, :attribute3, nested_model_name_here: [:attribute1, :attribute2, :attribute3])
so you can do something like this:
params.require(:product).permit(:title, :year, :region_id, disk_file: [:filename, :file_path, :title,
:product, :year, :region_id])
This is assuming that disk_file
's attributes is nested inside product
for params hash. If you still get an error, please post a dummy app on github which reproduces this behaviour. so I can help you further. Thanks