I'm trying to use curl to upload a file to my small Ruby on Rails application.
Here is the insert.html.haml
= form_for :my_result, :url=>{:action=> 'save'}, :html => {:multipart=>true} do |f|
= f.file_field :myfile
= submit_tag 'submit'
The "save" action will be invoked when the form is submitted. But the RoR action to view the form is the "insert" action.
I can view the "insert" form with a browser and then submit my file with no problem.
But I need to submit the file using curl.
When I do a curl -F [email protected] -F commit="submit" URL/insert, I only get back the "insert" form in HTML.
It doesn't seem to invoke the actual "save" action.
Started POST "/my_results/insert" for 10.15.120.173 at 2013-01-10 10:53:22 -0800
...
Rendered my_results/insert.html.haml within layouts/application (2.9ms)
I'm new to RoR and curl. I'd appreciate any help.
Thanks!