Hello everyone,
Sad to say I am having another problem with RoR, I am currently trying to get my upload file to work. But the only way I know how to do this is with <% form_tag :action => 'upload', :multipart => true %>, this works nice. But the stuff I need to do with my upload page won't work with this style so I need to use the form_remote_tag, but the problem is that the form_remote_tag doesn't like :multipart. And I need that in order for my controller to use the .orginal_filename function. I read that inside the :html {.....} of form_remote_tag I can put something simile to the :multipart, which is :enctype => 'multipart/form-data' , but again it doesn't work.
Does anyone have any idea's?
Here's my code in case you want to get an idea on what I am doing:<%= link_to_function 'Show/Hide Upload passwords form', "Effect.toggle('uploadPwForm', 'blind') ;" %>
<%= form_remote_tag :html => {:id => "uploadPwForm", :style => 'display: none;', :enctype => 'multipart/form-data'},
:url => {:action => 'upload_passwords', :form_id => 'uploadPwForm'},
:loading => "Element.show('loading')",
:complete => "Element.hide('loading')"
%>
<p><label for="password_entity_id">Entity</label>
<%= select : password, :entity_id, projectEntity.find(:all).collect {|e| [ e.name, e.id ] }, {: prompt => 'Choose one...'} %>
<p><label for="password_max_completes">Maximum Number of Completes</label>
<%= text_field : password, :max_completes, :size => 6, :value => 1 %></p>
<p><label for="password_file">Password File</label>
<%= file_field 'password', 'data' %></p>
<%= submit_tag "Upload Passwords" %>
<br /><br />
<%= link_to_function 'Close', "Effect.BlindUp('uploadPwForm');" %>
<br /><br />
<%= end_form_tag %>
__________________________________________________
Bookmarks