Anu
Joined: 01 Jan 2010 Posts: 36
|
Posted: Mon Feb 08, 2010 1:53 pm Post subject: FileColumn - easy handling of file uploads in Rails |
|
|
This file_column plugin handles saving files to the file system.
Resizing of images,creation of thumbnails.
here is a an example:
+Make the "image" column ready for handling uploaded files...
class Entry < ActiveRecord::Base
file_column :image
end
+ To generate file fields uploaded images form redisplays to your view...
<%= file_column_field "entry", "image" %>
+And display uploaded images in your view
<%= image_tag url_for_file_column("entry", "image") %>
+To resize uploaded image to a maximum size of 640x480, we have to declare an additional option.
class Entry < ActiveRecord::Base
file_column :image, :magick => { :geometry => "640x480>" }
end
list of features of file_column:
*Uploaded files are stored in the filesystem.
*For example, a uploaded file "test.png" is stored at "public/test.png".
*New uploaded files are stored in a temporary directory first, and they are available for redisplay the files.
*You can easily generate a file upload field in views .
Installtion of the file_column plugin:
script/plugin install http://opensvn.csie.org/rails_file_column/plugins/file_column/trunk
Thank you,
Anasuya.N |
|