hi,
I am porting an app from 1.2.5 to 2.0.2 and I am having problems with file uploads. The form fields look like this:
<%= 'Add attachment'.t %>: <%= file_field 'attachments', "upload#{id}", :size => '40' %>
The old code expects params[:attachments]["upload#{i}"] to be an object (File?) with a method "original_filename". I am using ajax (and previously didn't):
<% form_remote_tag(:url => url_for(:controller => :mex, :action => :submit_answer, :id => mex_exercise.id), :update => "answer_#{mex_exercise.id}", :html => {:multipart => mex_exercise.num_attachments_allowed > 0}) do %>
(num_attachments_allowed is > 0 and I see the enctype-attribute: <form action="/en/mex/submit_answer/46" enctype="multipart/form-data" method="post" onsubmit="new Ajax.Updater('answer_46', '/en/mex/submit_answer/46', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this) + '&authenticity_token=' + encodeURIComponent('a5de291b429a9def0d4ff822d8e278172e472a28')}); return false;"><div style="margin: 0pt; padding: 0pt;">)
Do I need to change anything because of ajax?
thanks,