Hello All,
I have been playing with file_column for a while and I love it. Thank you
Sebastian. For the last couple of days , I have been trying to upload
multiple files with a single file element as explained here
http://the-stickman.com/web-development/javascript/upload-multiple-files-with-a-single-file-element/
Unfortunately, Iam running into this error when I submit my form
undefined method `stringify_keys!'' for
#<File:C:/DOCUME~1/ssomasun/LOCALS~1/Temp/CGI6048.1>
Request
*Parameters*:
{"entry_0"=>#<File:C:/DOCUME~1/ssomasun/LOCALS~1/Temp/CGI6048.1>,
"Save"=>"Submit Query",
"entry_1"=>#<File:C:/DOCUME~1/ssomasun/LOCALS~1/Temp/CGI6048.0>}
My view is as below
<head>
<!-- Include the javascript -->
<%= javascript_include_tag "multifile" %>
</head>
<body>
<%= start_form_tag ({ :action => "create" }, :multipart =>
true) %>
<%= error_messages_for ''entry'' %><br/>
<!-- p>
<b>Picture1:</b><br />
<%= file_column_field "entry1", "image" %>
</p -->
<!-- The file element -- NOTE: it has an ID -->
<input type="file" id="my_file_element">
<p><input type="submit" name="Save"
/></p>
<%= end_form_tag %>
Files:
<!-- This is where the output will appear -->
<div id="files_list"></div>
<script>
<!-- Create an instance of the multiSelector class, pass it the output
target and the max number of files -->
var multi_selector = new MultiSelector( document.getElementById(
''files_list'' ), 3 );
<!-- Pass in the file element -->
multi_selector.addElement( document.getElementById(
''my_file_element'' )
);
</script>
My controller
def create
@entry = Entry.new(params[:entry_0])
if (@entry.save)
redirect_to :action => "show",:id => @entry
else
render :action => "add_item"
end
end
I would appreciate it if someone provided any input.
Thanks!
Sunder
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20051231/13bd8e4b/attachment.html