README.rdoc in uploader-1.0.0 vs README.rdoc in uploader-1.0.1
- old
+ new
@@ -1,15 +1,12 @@
= Uploader
-Uploader makes it easy to integrate multiple file uploads into your application using SWFUpload
+Uploader makes it easy to integrate multiple file uploads into your application using Uploadify or SWFUpload
== ----NOTES----
-SWFUpload hasn't been updated in a while. Uploader 0.2.8 has been updated with the latest beta version of SWFUpload but it appears to have errors in some instances.
-Version 0.2.8 will be the last version to use swfupload.
+SWFUpload hasn't been updated in a while and tends to be buggy. We have added uploadify. We recommend using that instead.
-We are currently working on a new upload gem that will use pupload
-
== Installation
=== Install the gem:
sudo gem install uploader
@@ -26,16 +23,13 @@
uploader uses jQuery. You'll need to include it in your application. Download it here:
http://jquery.com/
Then include it in your layout:
<%= javascript_include_tag 'jquery/jquery.js' %>
-
-Another option is to use jRails
-http://ennerchi.com/projects/jrails
=== Create a model for uploads.
-Creat an 'Upload' model in upload.rb. acts_as_uploader accepts all valid options for paperclip via :has_attached_file => {}
+Create an 'Upload' model in upload.rb. acts_as_uploader accepts all valid options for paperclip via :has_attached_file => {}
class Upload < ActiveRecord::Base
acts_as_uploader :enable_s3 => false,
:has_attached_file => {
@@ -111,11 +105,11 @@
default functionality that you may consider overriding.
Be sure to modify your routes file. Add the following line to ensure that your application uses the new uploads
controller instead of directly using the one inside the gem:
- map.resources :uploads, :collection => { :swfupload => :post }
+ map.resources :uploads, :collection => { :multiupload => :post }
class UploadsController < Uploader::UploadsController
prepend_before_filter :login_required
@@ -169,13 +163,19 @@
You'll need something like this in your layout so that uploader can add in the required css and javascript files.
<%= yield :head -%>
Then to add an upload form:
+
+SWFUpload version:
<%= upload_form(parent_object) %>
-parent_object should be the object which owns the uploads. ie a user, photo_album, etc.
+Uploadify version (recommended):
+<%= uploadify_form(parent_object) %>
+
+See the uploader_helper.rb file for options. parent_object should be the object which owns the uploads. ie a user, photo_album, etc.
+
=== Rake Tasks
Add the rake tasks for uploader to your project. You will need to add the following to your applications's Rakefile
require 'uploader'
@@ -302,24 +302,21 @@
</tr>
I put the following in my main upload view
<% content_for :javascript do -%>
-
setup_submit_delete();
-
function upload_completed_callback(data){
jQuery('#upload-list').prepend(data);
- setup_submit_delete();
}
<% end -%>
The following jQuery code will do an ajax delete for you
function setup_submit_delete(){
- jQuery(".submit-delete").click(function() {
+ jQuery(".submit-delete").live('click', function() {
// if(!confirm("Are you sure?")){
// return false;
// }
jQuery(this).parents('.delete-container').fadeOut();
var form = jQuery(this).parents('form');