Notifications
You’re not receiving notifications from this thread.
How can I upload a file from the console
I'm trying to write a controller action that will create records with attachments from a form submission where the form has multiple true set for the file_field I wanna take the params from the form like caption and create a new record for each of the multiple files selected with the same caption but a different image so I'd be iterating through the selected files and creating a new record for each one I have to admit this may not be a good idea, it's a has_many_through setup allowing users to click on images to see records from associated tables It made sense for my old west site where pictures are significant but now I'm using the same code copied to on an e-commerce site I have to admit it's a pain but I wanna get a handle on it before migrating to a different approach so for the time being to help me write my controller action I wanna work out the core functions in console so my question is how do I upload a file from the console