This is straight from the file_column website: Just create a database column to store the filename: add_column :entry,:image,:string Then make the “image” column ready for handling uploaded files… class Entry < ActiveRecord::Base file_colu... 続きを読む
file_column プラグインと言えば、普通はファイルのアップロードに使うもの。しかし、実際には既存のファイルを新システムに移行させるときなどに、ローカルにあるファイルをデータベースに登録したいときがある。たとえば、Entry モデルに image という属性が... 続きを読む