I am attempting to essentially pass a variable from one page url to another to assist in filling out a form.
I have a Script
model and a Prescription
model. Each script can have multiple prescriptions. So on the Scripts show page, I'm wanting to have a create button that allows users to click it, and it sends them to the Prescriptions create page, but auto-fills out the script_id
for the user in the controller. This way it is definitively tagged to the correct script.
So if someone clicks on 'Create Prescription' on test.com/scripts/34/show
, it takes them to test.com/prescriptions/create
and automatically applies 34
as the script_id
field - ideally either a hidden field, or directly passed to the controller somehow so that the user can't tamper with it.