Forum: Ruby on Rails file_column : _temp field always nil

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.
Eric S. (Guest)
on 2006-05-03 20:59
(Received via mailing list)
Hi,
I'm trying to set up file_column to upload attachments for emails. My
view has <td align="left"><%= file_column_field 'to_do', 'attachment'
%></td> and the attachment_temp hidden field is generated. When I
inspect tthe params on saving the form the attachment_temp param is
always an empty string. Also, when I was setting this up I got a no
method error attachment_temp on save and had to (temporarily I hope) add
that field to the table. The to_do model has 'file_column :attachment'
On save, the attachment field is updated with the correct file name but
no upload takes place. I'm just not seeing why the _temp field is not
gwtting a value. Any clues?
TIA,
Eric.
Brian Ã?gren (Guest)
on 2006-05-03 20:59
(Received via mailing list)
your form properbly misses multipart encoding ala

<form action="/something" METHOD='POST' ENCTYPE='multipart/form-data'>
Eric S. (Guest)
on 2006-05-03 21:05
(Received via mailing list)
Hi Brian,
Thanks for the response. I have
<%= start_form_tag :controller => 'to_dos', :action => 'add_to_dos', :id
=> @job, :multipart => true %>
in my view which is generating
<form action="/to_dos/add_to_dos/1?multipart=true" method="post"> - but
I still get an error re: Check if the form's encoding has been set to
'multipart/form-data'. Can you see anything wrong here?
Cheers,
Eric.
Eric S. (Guest)
on 2006-05-03 21:05
(Received via mailing list)
Hi,
Have solved my own dumb problem - I shoulda been putting braces around
my  url_for_options and options when I added the multipart statement.
Sorry to be a nuisance
Cheers,
Eric.
This topic is locked and can not be replied to.