File Column 0.3
Here is the new 0.3 release of the file_column library that makes handling of file uploads in rails really easy.
So what’s new? The most prominent new feature is an integration of rmagick/imagemagick so that you can easily resize uploaded images and create multiple versions in different sizes. Many thanks to Kyle Maxwell for his ideas on this subject.
You certainly ask yourself how this works? It’s very straightforward, as always. Let me just show you an example:
class Entry
file_column :image, :magick => { :geometry => "640x400>" }
end
Just grab the release and look at the docs for more details.
As an additional goodie, I converted file_column to a rails plugin, so you can just drop it into your “vendor/plugins” directory and you’re done. This plugin thingie is certainly a cool new feature in rails.
For all of you, interested in all the details: Here’s a list of all the changes since the last version straight from the changelog:
- fixed bug where empty file uploads were not recognized with some browsers
- fixed bug on windows when “file” utility is not present
- added option to disable automatic file extension correction
- Only allow one attribute per call to file_column, so that options only apply to one argument
- try to detect when people forget to set the form encoding to ‘multipart/form-data’
- converted to rails plugin
- easy integration with RMagick