I would like to obtain low from the following URL, but if anyone knows how to do it, please let me know.
URL: http://100.100.100/test/site/page/1?money%5Bgo_to%5D=low
Also, the place to retrieve will be in before_save.
Below is the verified acquisition code.None of them moved.
params[:money.go_to]
params[:money][:go_to]
If before_save
refers to the callback of the model, you cannot see params
from there.
You can also define attributes in the model that do not correspond to columns in the database.It is recommended that the controller take the value from the params and pass the value through it.The attributes corresponding to the columns in the database are almost the same, except that they are not stored in the database.
class User<...
attribute:hoge
end
@user=User.new
user.hoge=params [:money] [:go_to]
542 Unable to install versioned in Google Colab
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
549 PHP ssh2_scp_send fails to send files as intended
538 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.