Forum: Ruby on Rails File_column and multiple file select

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2005-12-31 01:56
(Received via mailing list)
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...

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
This topic is locked and can not be replied to.