You mentioned that we should see everything in terms of the restful actions of create, replace, update and delete. So I was thinking back to an app that I just wrote that works with patient records. I have an upload feature to load in data from a zip file. There is a form to gather the file name and an “upload_file” method on the controller. Of course, I had to create a specific route.
So my thoughts were to see this as a type of create for patient records. If the value upload file is found in the params, then the create action would call the upload method, otherwise it would create a single patient record. Does that sound right?
If so, then how best to implement following the new best practices and conventions. For the view, I don’t believe I can do a form_for @patient because I am creating a collection of them.
<%= form_tag("/patients/", :method => “put”, :multipart=>true) do %>
This works and generates a post to patients. I would assume that I would need to pass “fileupload” switch as a hidden field with default value of true such as I am doing with the file name:
Thoughts or suggestions.