- File column
Infobox_Software
name = file_column
developer =Sebastian Kanthak
latest_release_version = 0.3.1
latest_release_date =November 14 ,2005
genre =Ruby on Rails Plugin
license =MIT License
website = [http://www.kanthak.net/opensource/file_column/ http://www.kanthak.net/opensource/file_column/]file_column is a popular
plugin forRuby on Rails that allows the easy management of file uploads.The file_column system is designed to upload a file to a
directory named after its objectID (usually theprimary key in thedatabase table ) this allows for the uploading of different images with the same name.The default structure of file storage in file_column is:
name_of_your_object/column_name/objectid/filename.ext
Usage
To install via command line, this code is used:
./script/plugin install http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk After the package is installed in your desired Rails application:
First the plugin is referenced from within your 'entry' model.
file_column :image
On any form for file uploads reference your upload like so.
<%= file_column_field('entry', 'image' ) %>
Finally when referencing an uploaded file, this tag is available.
<%= url_for_file_column('entry', 'image') %>
"NB - The model name (entry) and the instance/datebase column name (image) must be identical for both
file_column_field()
andurl_for_file_column()
"ee also
*
Ruby on Rails
*mod ruby External links
* [http://www.kanthak.net/opensource/file_column/ Sebastian Kanthak's File Column Site]
* [http://wiki.rubyonrails.org/rails/pages/HowToUseFileColumn File Column at Rubyonrails.org Wiki]
* [http://www.bopia.com/log/2006/08/how_to_upload_images_with_file.php Bopia Guide to Using File Column]
Wikimedia Foundation. 2010.