use file_column
http://www.kanthak.net/opensource/file_column/
plenty of info on the list here about it.
adam
On 1/22/06, Dylan Markow <dylan@dylanmarkow.com>
wrote:> 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!
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>