Every time I think I'm "getting" RoR something trivial kicks my
butt. All I am trying to do is upload text files for processing.
I’ve stripped everything out of my code in order to troubleshoot this
and I’ve hit a wall :
<%= form_tag :action=>“savefile”, :multipart=>true%>
<%= file_field (:scanfile, :thefile) %>
<%= submit_tag “upload file” %>
<%= end_form_tag %>
@thefile = params[:scanfile][:thefile]
The problem is that what I get from the params hash is always just a
plain string. It is not a file object with .read or .content_type
methods. I get this error in firefox:
undefined method `conent_type’ for “scandata.txt”:String
Can anyone spot what I have done wrong? I swear that I’ve used this
same simple approach successfully in other apps.