I want to duplicate a record, but it doesn't pull the parameters.
What I tried
def update_new @retrieve_list = RetrieveList.new @retrieve_list = RetrieveList.find (params [: id]). dup @ retrieve_list.save end
I tried to write this on the SHOW screen.
def show @retrieve_list = RetrieveList.new @retrieve_list = RetrieveList.find (params [: id]). dup @ retrieve_list.save end
In this case, Link_to pulled the ID.
However, every time I go to the show screen, it is duplicated, which is a big deal.
The ideal is the former, and if you pull the ID, it seems to succeed ...
If i can teach me something with these tips, I would appreciate it.
Answer # 1
link_toSince the parameters are not sent just by changing the page with
params.require (: retrieve_list)Does not exist and an error occurs.
- ruby on rails 6 - about validation (number of characters) of rails tweet posting
- ruby on rails - about image posting page argumenterror
- ruby - about error of update action when nesting
- about description of manifest file of ruby on rails
- ruby - about accelerating heroku's rails app
- ruby on rails 5 - about lint/syntax error of rubocop
- vba - about id number when registering a record from the access form
- ruby - about the problem of duplicate devise error messages (allow_blank: ture doesn't work!)
- ruby - about the error content displayed in "rails" rspec
- ruby on rails - rails render: about the matter that the url after new is different
- ruby on rails 5 - child model record not created
- ruby - [rails] about partial templates
- [ruby on rails] about header setting using bootstrap
- ruby on rails - about screen transition from rails top page to calendar page
- ruby on rails 6 - about rails error "wrong number of arguments (given 1, expected 0)"
- ruby on rails - about rails create action
- about displaying a form in the access macro "new record"
- ruby - i want to modularize active record methods
- ruby on rails - about multi-word search to multiple columns using ransack
- ruby - passing variables using render partial
- i get a bundler 213 error when creating an app in ruby 27
- ruby - i want to use the search method for active hash data
- ruby - destroy action does not respond
- ruby - how do you see the rails controller relative path? (carrierwave directory deleted)
- ruby - when deploying on capistrano, i get the error "access denied for user'ec2-user' @'localhost' (using password: no)&qu
- how to reflect the layout downloaded from the external site in ruby on rails?
- ruby - how nice! function routes do not pass well (relation) [rails]
- [ruby/rails] when you want to replace in a specific character string