Consider the following two ways of doing forms, both with :multipart => true. Only the form_for will work properly when using attachment_fu
<code> <%= form_tag :action => 'create', :multipart => true %> <%= file_field 'assignment', :uploaded_data %> <%= submit_tag "Create" %> <%= end_form_tag %> </code>
HTML: <code> <form action="/assignment/create?multipart=true" method="post"> </code>
<code> <% form_for :assignment, :url => {:action => 'create'}, :html => {:multipart => true}) do |f| %> <%= file_field :assignment, :uploaded_data %> <%= submit_tag "Upload Assignment" %> <% end %> </code>
HTML:
<code> <form action="/assignment/create" enctype="multipart/form-data" method="post"> <input id="assignment_uploaded_data" name="assignment[uploaded_data]" size="30" type="file" /> <input name="commit" type="submit" value="Upload Assignment" /> </form> </code>
Only the second form works with attachment_fu. Why are these two translations incompatible? I would expect the enctype to be specified on the first form above.
Thanks for any feedback,
Gordon