file_colum

1223 단어 ActiveRecordRails
file_column        ,      ,        ROR  


./script/plugin install http://opensvn.csie.org/rails_file_column/ plugins/file_column/trunk

 model   
validates_format_of :image,       :with=>/^.*(.jpg|.JPG|.gif|.GIF)$/,       :message => "JPG 또는 GIF 그림 파일 만 업로드 할 수 있 습 니 다".     file_column :image, :magick => {             :versions => { "thumb" => "50x50", "medium" => "640x480>" }        }  

Just make the "image" column ready for handling uploaded files...

    class Entry < ActiveRecord::Base         file_column :image     end     

view :

... generate file fields that keep uploaded images during form redisplays to your view...

    <!---->     

... and display uploaded images in your view:

    <!---->     

좋은 웹페이지 즐겨찾기