Forum: Ruby on Rails file_field questions

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.
D9d1b31a337f46ac5e4dd56b55404f58?d=identicon&s=25 Dylan Markow (Guest)
on 2006-01-22 20:04
(Received via mailing list)
A couple questions about file_field elements.

First, with code such as this:

<%= file_field 'attachments', 'filename' %>

Would the filename of the file I select be the value that's stored
within the database under the "filename" column, and then I would just
add in code in my "create" controller to upload the actual file?

Second, when I have a tag such as above, and my form throws an error,
the field clears. For example, if I selected a filename and entered a
date, but no description, the form will come back saying "title can't be
blank." The date I entered will still be there, but the file selector
will be empty. Any way around this? Thanks!
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-01-22 20:07
(Received via mailing list)
use file_column

http://www.kanthak.net/opensource/file_column/

plenty of info on the list here about it.

adam
This topic is locked and can not be replied to.