# File\_column plugin

**URL:** <https://www.ruby-forum.com/t/file-column-plugin/124851>\
**Category:** Rails\
**Created:** [January 3, 2008, 4:46am UTC](https://www.ruby-forum.com/t/file-column-plugin/124851 "2008-01-03T04:46:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clouder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/0ea827/32.png) [@clouder](https://www.ruby-forum.com/u/clouder)\
**Post date:** [January 3, 2008, 4:46am UTC](https://www.ruby-forum.com/t/file-column-plugin/124851/1 "2008-01-03T04:46:34Z")

</div>

I’m using file\_column to allow image uploads to a site.

Model Version 1  
class Cimage \< ActiveRecord::Base  
belongs\_to :car  
file\_column :image

validates\_presence\_of :image  
validates\_presence\_of :text  
validates\_file\_format\_of :image, :in =\> [“jpg”, “gif”]  
end

Model Version 2  
class Cimage \< ActiveRecord::Base  
belongs\_to :car  
file\_column :image, :magick =\> { :versions =\> { :thumb =\> { :size =\>  
‘150x100’ } } }

validates\_presence\_of :image  
validates\_presence\_of :text  
validates\_file\_format\_of :image, :in =\> [“jpg”, “gif”]  
end

Version 1 works fine for both jpg and gif, but Version 2 will only be  
successful for gifs. I get a validation error that ‘Image was not a  
valid image,’ every time a try to upload a jpg. Can anyone please  
help shed some light on what the heck is going on here.
