uploader 0.1.3 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +81 -33
- data/Rakefile +2 -2
- data/TODO +2 -1
- data/VERSION +1 -1
- data/app/controllers/uploader/uploads_controller.rb +13 -9
- data/app/views/uploads/_swf_upload.html.erb +1 -1
- data/lib/active_record/acts/uploader_upload.rb +12 -13
- data/lib/daemons/amazonaws.rb +36 -0
- data/lib/uploader/tasks.rb +9 -3
- data/public/images/file_icons/excel.gif +0 -0
- data/public/images/file_icons/file.gif +0 -0
- data/public/images/file_icons/file.png +0 -0
- data/public/images/file_icons/file_aac.gif +0 -0
- data/public/images/file_icons/file_ai.gif +0 -0
- data/public/images/file_icons/file_avi.gif +0 -0
- data/public/images/file_icons/file_bin.gif +0 -0
- data/public/images/file_icons/file_bmp.gif +0 -0
- data/public/images/file_icons/file_cue.gif +0 -0
- data/public/images/file_icons/file_divx.gif +0 -0
- data/public/images/file_icons/file_doc.gif +0 -0
- data/public/images/file_icons/file_eps.gif +0 -0
- data/public/images/file_icons/file_flac.gif +0 -0
- data/public/images/file_icons/file_flv.gif +0 -0
- data/public/images/file_icons/file_gif.gif +0 -0
- data/public/images/file_icons/file_html.gif +0 -0
- data/public/images/file_icons/file_ical.gif +0 -0
- data/public/images/file_icons/file_indd.gif +0 -0
- data/public/images/file_icons/file_inx.gif +0 -0
- data/public/images/file_icons/file_iso.gif +0 -0
- data/public/images/file_icons/file_jpg.gif +0 -0
- data/public/images/file_icons/file_mov.gif +0 -0
- data/public/images/file_icons/file_mp3.gif +0 -0
- data/public/images/file_icons/file_mpg.gif +0 -0
- data/public/images/file_icons/file_pdf.gif +0 -0
- data/public/images/file_icons/file_php.gif +0 -0
- data/public/images/file_icons/file_png.gif +0 -0
- data/public/images/file_icons/file_pps.gif +0 -0
- data/public/images/file_icons/file_ppt.gif +0 -0
- data/public/images/file_icons/file_psd.gif +0 -0
- data/public/images/file_icons/file_qxd.gif +0 -0
- data/public/images/file_icons/file_qxp.gif +0 -0
- data/public/images/file_icons/file_raw.gif +0 -0
- data/public/images/file_icons/file_rtf.gif +0 -0
- data/public/images/file_icons/file_svg.gif +0 -0
- data/public/images/file_icons/file_tif.gif +0 -0
- data/public/images/file_icons/file_txt.gif +0 -0
- data/public/images/file_icons/file_vcf.gif +0 -0
- data/public/images/file_icons/file_wav.gif +0 -0
- data/public/images/file_icons/file_wma.gif +0 -0
- data/public/images/file_icons/file_xls.gif +0 -0
- data/public/images/file_icons/file_xml.gif +0 -0
- data/public/images/file_icons/pdf.gif +0 -0
- data/public/images/file_icons/pdf.png +0 -0
- data/public/images/file_icons/text.gif +0 -0
- data/public/images/file_icons/text.png +0 -0
- data/rdoc/classes/ActionController/Routing/RouteSet.html +148 -0
- data/rdoc/classes/ActionController/Routing.html +107 -0
- data/rdoc/classes/ActionController.html +107 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/ClassMethods.html +188 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/InstanceMethods.html +750 -0
- data/rdoc/classes/ActiveRecord/Acts/UploaderUpload/SingletonMethods.html +111 -0
- data/rdoc/classes/ActiveRecord.html +105 -0
- data/rdoc/classes/Uploader/Exceptions/MissingTemplateError.html +111 -0
- data/rdoc/classes/Uploader/Exceptions.html +111 -0
- data/rdoc/classes/Uploader/FlashSessionCookieMiddleware.html +177 -0
- data/rdoc/classes/Uploader/MimeTypeGroups.html +143 -0
- data/rdoc/classes/Uploader/Tasks.html +146 -0
- data/rdoc/classes/Uploader.html +126 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_rdoc.html +427 -0
- data/rdoc/files/lib/active_record/acts/uploader_upload_rb.html +101 -0
- data/rdoc/files/lib/uploader/exceptions_rb.html +101 -0
- data/rdoc/files/lib/uploader/initialize_routes_rb.html +101 -0
- data/rdoc/files/lib/uploader/middleware/flash_session_cookie_middleware_rb.html +108 -0
- data/rdoc/files/lib/uploader/mime_type_groups_rb.html +101 -0
- data/rdoc/files/lib/uploader/tasks_rb.html +110 -0
- data/rdoc/files/lib/uploader_rb.html +112 -0
- data/rdoc/fr_class_index.html +39 -0
- data/rdoc/fr_file_index.html +34 -0
- data/rdoc/fr_method_index.html +54 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/uploader.gemspec +72 -20
- metadata +72 -5
- data/pkg/uploader-0.1.0.gem +0 -0
- data/pkg/uploader-0.1.1.gem +0 -0
- data/pkg/uploader-0.1.2.gem +0 -0
@@ -0,0 +1,427 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README.rdoc</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README.rdoc</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README.rdoc
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Fri May 22 14:12:09 -0600 2009</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1><a href="../classes/Uploader.html">Uploader</a></h1>
|
73
|
+
<p>
|
74
|
+
<a href="../classes/Uploader.html">Uploader</a> makes it easy to integrate
|
75
|
+
multiple file uploads into your application using SWFUpload
|
76
|
+
</p>
|
77
|
+
<h2>Installation</h2>
|
78
|
+
<h3>Install Dependancies:</h3>
|
79
|
+
<p>
|
80
|
+
sudo gem install mime-types
|
81
|
+
</p>
|
82
|
+
<h3>Install the gem:</h3>
|
83
|
+
<p>
|
84
|
+
sudo gem install uploader
|
85
|
+
</p>
|
86
|
+
<h3>Add the gem to environment.rb</h3>
|
87
|
+
<p>
|
88
|
+
config.gem ‘uploader‘
|
89
|
+
</p>
|
90
|
+
<h3>Create a model for uploads.</h3>
|
91
|
+
<p>
|
92
|
+
We recommend creating a model called upload.rb. acts_as_uploader accepts
|
93
|
+
all valid options for paperclip via :has_attached_file => {}
|
94
|
+
</p>
|
95
|
+
<pre>
|
96
|
+
class Upload < ActiveRecord::Base
|
97
|
+
acts_as_uploader :enable_s3 => false,
|
98
|
+
:has_attached_file => {
|
99
|
+
:url => "/system/:attachment/:id_partition/:style/:basename.:extension",
|
100
|
+
:path => ":rails_root/public/system/:attachment/:id_partition/:style/:basename.:extension",
|
101
|
+
:styles => { :icon => "30x30!",
|
102
|
+
:thumb => "100>",
|
103
|
+
:small => "150>",
|
104
|
+
:medium => "300>",
|
105
|
+
:large => "660>"},
|
106
|
+
:default_url => "/images/profile_default.jpg",
|
107
|
+
:storage => :s3,
|
108
|
+
:s3_credentials => File.join(RAILS_ROOT, 'config', 's3.yml'),
|
109
|
+
:bucket => "assets.#{SITE[:domain]}",
|
110
|
+
:s3_host_alias => "assets.#{SITE[:domain]}",
|
111
|
+
:convert_options => {
|
112
|
+
:all => '-quality 80'
|
113
|
+
}
|
114
|
+
|
115
|
+
# only allow images:
|
116
|
+
# validates_attachment_content_type :file, :content_type => ['image/jpeg', 'image/pjpeg', 'image/jpg']
|
117
|
+
|
118
|
+
# The following method is implemented in 'acts_as_uploader'. This is the method destroy will check to see if
|
119
|
+
# the user has permission to delete the object. Add additional logic as needed or if the existing logic
|
120
|
+
# looks fine then feel free to delete this comment and the can_edit? method.
|
121
|
+
def can_edit?(check_user)
|
122
|
+
return false if user.blank?
|
123
|
+
check_user == self.user
|
124
|
+
end
|
125
|
+
|
126
|
+
end
|
127
|
+
</pre>
|
128
|
+
<h3>Add multiple file uploads to one of your models</h3>
|
129
|
+
<p>
|
130
|
+
Your uploads will need a parent object to attach to. For example, a user
|
131
|
+
might have many files:
|
132
|
+
</p>
|
133
|
+
<pre>
|
134
|
+
class User < ActiveRecord::Base
|
135
|
+
has_many :uploads, :as => :uploadable, :order => 'created_at desc', :dependent => :destroy
|
136
|
+
|
137
|
+
def can_upload?(check_user)
|
138
|
+
self == check_user
|
139
|
+
end
|
140
|
+
end
|
141
|
+
</pre>
|
142
|
+
<p>
|
143
|
+
or a photo album might have many photos
|
144
|
+
</p>
|
145
|
+
<pre>
|
146
|
+
class PhotoAlbum < ActiveRecord::Base
|
147
|
+
has_many :photos, :as => :uploadable, :order => 'created_at desc', :dependent => :destroy
|
148
|
+
|
149
|
+
def can_upload?(check_user)
|
150
|
+
self.editors.include?(check_user)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
</pre>
|
154
|
+
<p>
|
155
|
+
Note that in both examples there is an implementation of
|
156
|
+
‘can_upload?’. This method must be included in any parent
|
157
|
+
object and will control who has permission to upload files.
|
158
|
+
</p>
|
159
|
+
<h3>The application controller</h3>
|
160
|
+
<p>
|
161
|
+
Be sure you have turned on protect from forgery. This is required for
|
162
|
+
uploader to get the appropriate tokens from your Rails application. It is
|
163
|
+
also a good idea and is the default in new Rails applications.
|
164
|
+
</p>
|
165
|
+
<pre>
|
166
|
+
protect_from_forgery # See ActionController::RequestForgeryProtection for details
|
167
|
+
</pre>
|
168
|
+
<h3>The uploads controller</h3>
|
169
|
+
<p>
|
170
|
+
You can modify the upload controller behavior by inheriting from the
|
171
|
+
uploader controller. For example, you might want to require that users be
|
172
|
+
logged in to upload a file. There are a number of methods in the uploads
|
173
|
+
controller that contain default functionality that you may consider
|
174
|
+
overriding.
|
175
|
+
</p>
|
176
|
+
<p>
|
177
|
+
Be sure to modify your routes file. Add the following line to ensure that
|
178
|
+
your application uses the new uploads controller instead of directly using
|
179
|
+
the one inside the gem:
|
180
|
+
</p>
|
181
|
+
<pre>
|
182
|
+
map.resources :uploads, :collection => { :swfupload => :post }
|
183
|
+
|
184
|
+
class UploadsController < Uploader::UploadsController
|
185
|
+
|
186
|
+
before_filter :login_required
|
187
|
+
|
188
|
+
protected
|
189
|
+
|
190
|
+
# The default 'get_upload_text' method throws an exception. You must override this method in your controller. It
|
191
|
+
# is used by the swf upload call to generate the html to be returned to the client.
|
192
|
+
# Here's an example:
|
193
|
+
def get_upload_text(upload)
|
194
|
+
render_to_string( :partial => 'uploads/upload_row', :object => upload, :locals => { :parent => @parent } )
|
195
|
+
end
|
196
|
+
|
197
|
+
# The existing method will handle most cases but you might choose a different message or a different redirect:
|
198
|
+
def permission_denied
|
199
|
+
message = t("uploader.permission_denied")
|
200
|
+
respond_to do |format|
|
201
|
+
format.html do
|
202
|
+
flash[:notice] = message
|
203
|
+
redirect_to get_redirect
|
204
|
+
end
|
205
|
+
format.js { render :text => message }
|
206
|
+
format.json { render :json => { :success => false, :message => message } }
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Simply attempts to redirect to the parent object. You might want to build something more sophisticated that
|
211
|
+
# redirect to different areas of you site depending on the type of object that was uploaded or on based on the parent.
|
212
|
+
def get_redirect
|
213
|
+
@parent
|
214
|
+
end
|
215
|
+
|
216
|
+
# The default action is to call 'can_upload?' on the parent object. Be sure to implement 'can_upload?(check_user) on
|
217
|
+
# your parent objects
|
218
|
+
def has_permission_to_upload(user, upload_parent)
|
219
|
+
upload_parent.can_upload?(user)
|
220
|
+
end
|
221
|
+
|
222
|
+
# By default the controller will use a model named 'Upload' to do a destroy. If you want to use a different model
|
223
|
+
# you'll need to override 'set_upload_for_destroy in your controller to find the object using a different object.
|
224
|
+
# For example:
|
225
|
+
def set_upload_for_destroy
|
226
|
+
@upload = Photo.find(params[:id])
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
</pre>
|
231
|
+
<h3>Other Methods</h3>
|
232
|
+
<p>
|
233
|
+
uploader assumes that you have a method called
|
234
|
+
‘redirect_back_or_default’ which is common in many Rails
|
235
|
+
projects. This method is called upon completion of destroy or created when
|
236
|
+
the requested format is ‘html’. A simple implementation of this
|
237
|
+
method is listed below:
|
238
|
+
</p>
|
239
|
+
<pre>
|
240
|
+
def redirect_back_or_default(default)
|
241
|
+
redirect_to(session[:return_to] || default)
|
242
|
+
session[:return_to] = nil
|
243
|
+
end
|
244
|
+
</pre>
|
245
|
+
<h3>Configure your views.</h3>
|
246
|
+
<p>
|
247
|
+
You‘ll need something like this in your layout so that uploader can
|
248
|
+
add in the required css and javascript files.
|
249
|
+
</p>
|
250
|
+
<p>
|
251
|
+
<%= yield :head -%>
|
252
|
+
</p>
|
253
|
+
<p>
|
254
|
+
Then to add an upload form: <%= upload_form(parent_object) %>
|
255
|
+
parent_object should be the object which owns the uploads. ie a user,
|
256
|
+
photo_album, etc.
|
257
|
+
</p>
|
258
|
+
<h3>Rake Tasks</h3>
|
259
|
+
<p>
|
260
|
+
Add the rake tasks for uploader to your project. You will need to add the
|
261
|
+
following to your applications‘s Rakefile
|
262
|
+
</p>
|
263
|
+
<pre>
|
264
|
+
require 'uploader'
|
265
|
+
require 'uploader/tasks'
|
266
|
+
</pre>
|
267
|
+
<p>
|
268
|
+
Then run:
|
269
|
+
</p>
|
270
|
+
<pre>
|
271
|
+
rake uploader:sync
|
272
|
+
</pre>
|
273
|
+
<p>
|
274
|
+
Last run:
|
275
|
+
</p>
|
276
|
+
<pre>
|
277
|
+
rake db:migrate
|
278
|
+
</pre>
|
279
|
+
<p>
|
280
|
+
This will create an uploads table for you. If you selected a different name
|
281
|
+
for your model you will need to modify the migration accordingly.
|
282
|
+
</p>
|
283
|
+
<h2>WARNING</h2>
|
284
|
+
<p>
|
285
|
+
The migration will drop any existing ‘uploads’ table you have
|
286
|
+
in place
|
287
|
+
</p>
|
288
|
+
<p>
|
289
|
+
That will copy all the required javascript and asset files into your
|
290
|
+
project
|
291
|
+
</p>
|
292
|
+
<h2>Amazon s3</h2>
|
293
|
+
<p>
|
294
|
+
If you‘d like to store your uploads on Amazon‘s S3 service
|
295
|
+
there are a few extra steps involved. See the example file above to view
|
296
|
+
the options in context.
|
297
|
+
</p>
|
298
|
+
<h3>Turn on s3</h3>
|
299
|
+
<p>
|
300
|
+
Set the enable_s3 option to true in acts_as_uploader
|
301
|
+
</p>
|
302
|
+
<pre>
|
303
|
+
:enable_s3 => true
|
304
|
+
</pre>
|
305
|
+
<p>
|
306
|
+
Pass your s3 credentials into acts_as_uploader
|
307
|
+
</p>
|
308
|
+
<pre>
|
309
|
+
:has_attached_file => { :s3_credentials => File.join(RAILS_ROOT, 'config', 's3.yml') }
|
310
|
+
</pre>
|
311
|
+
<h3>Setup your credentials</h3>
|
312
|
+
<p>
|
313
|
+
Create a file named s3.yml in your configuration directory and add the
|
314
|
+
following lines:
|
315
|
+
</p>
|
316
|
+
<pre>
|
317
|
+
access_key_id: PUT YOUR KEY HERE
|
318
|
+
secret_access_key: PUT YOUR SECRET ACCESS KEY HERE
|
319
|
+
</pre>
|
320
|
+
<h3>Turn on the Daemon process</h3>
|
321
|
+
<p>
|
322
|
+
There are a number of timing issues that you will run into if you attempt
|
323
|
+
to upload files directly to s3. To overcome that problem uploader includes
|
324
|
+
a daemon process which will send the files to Amazon asynchronously. Note
|
325
|
+
that the uploader will leave your local copy in place. TODO docs for Daemon
|
326
|
+
</p>
|
327
|
+
<h2>Other Stuff</h2>
|
328
|
+
<p>
|
329
|
+
If you‘d like to add an ajax delete to your uploads page this code
|
330
|
+
might come in handy.
|
331
|
+
</p>
|
332
|
+
<p>
|
333
|
+
Say you have chosen to display your upload in a table. Your code might look
|
334
|
+
like the following. Note that there are a number of assumptions made in
|
335
|
+
this code. Modify it to suite your needs.
|
336
|
+
</p>
|
337
|
+
<pre>
|
338
|
+
<tr id="<%= upload_row.dom_id %>" class="delete-container <%= cycle('odd', 'even') %>" <%=style-%> >
|
339
|
+
<td><div class="file-icon"><%= image_tag upload_row.icon -%></div></td>
|
340
|
+
<td><a href="<%=upload_row.file.url%>"><%= truncate(sanitize(upload_row.file_name), 100) %></a></td>
|
341
|
+
<td><%= upload_row.created_at.to_s(:long) -%></td>
|
342
|
+
<td>
|
343
|
+
<% if parent.can_edit?(current_user) -%>
|
344
|
+
<% form_for(:upload, :url => upload_path(upload_row.id), :html => { :class => "delete-form", :method => :delete} ) do |f| -%>
|
345
|
+
<%= image_submit_tag '/images/icons/delete.png', {:id => 'submit-comment', :title => t('general.delete_file'), :class => 'submit-delete', :width => '12', :height => '12', :alt => t('general.delete_file') } %>
|
346
|
+
<% end -%>
|
347
|
+
<% if !style.empty? -%>
|
348
|
+
<script type="text/javascript" language="JavaScript">
|
349
|
+
jQuery("#<%= upload_row.dom_id %>").fadeIn("slow");
|
350
|
+
</script>
|
351
|
+
<% end -%>
|
352
|
+
<% end -%>
|
353
|
+
</td>
|
354
|
+
</tr>
|
355
|
+
</pre>
|
356
|
+
<p>
|
357
|
+
I put the following in my main upload view
|
358
|
+
</p>
|
359
|
+
<pre>
|
360
|
+
<% content_for :javascript do -%>
|
361
|
+
|
362
|
+
setup_submit_delete();
|
363
|
+
|
364
|
+
function upload_completed_callback(data){
|
365
|
+
jQuery('#upload-list').prepend(data);
|
366
|
+
setup_submit_delete();
|
367
|
+
}
|
368
|
+
<% end -%>
|
369
|
+
</pre>
|
370
|
+
<p>
|
371
|
+
The following jQuery code will do an ajax delete for you
|
372
|
+
</p>
|
373
|
+
<pre>
|
374
|
+
function setup_submit_delete(){
|
375
|
+
jQuery(".submit-delete").click(function() {
|
376
|
+
// if(!confirm("Are you sure?")){
|
377
|
+
// return false;
|
378
|
+
// }
|
379
|
+
jQuery(this).parents('.delete-container').fadeOut();
|
380
|
+
var form = jQuery(this).parents('form');
|
381
|
+
jQuery.post(form.attr('action') + '.json', form.serialize(),
|
382
|
+
function(data){
|
383
|
+
var json = eval('(' + data + ')');
|
384
|
+
if(!json.success){
|
385
|
+
jQuery.jGrowl.info(json.message);
|
386
|
+
}
|
387
|
+
});
|
388
|
+
return false;
|
389
|
+
});
|
390
|
+
}
|
391
|
+
</pre>
|
392
|
+
<p>
|
393
|
+
Copyright (c) 2009 Justin Ball, released under the MIT license
|
394
|
+
</p>
|
395
|
+
|
396
|
+
</div>
|
397
|
+
|
398
|
+
|
399
|
+
</div>
|
400
|
+
|
401
|
+
|
402
|
+
</div>
|
403
|
+
|
404
|
+
|
405
|
+
<!-- if includes -->
|
406
|
+
|
407
|
+
<div id="section">
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
<!-- if method_list -->
|
417
|
+
|
418
|
+
|
419
|
+
</div>
|
420
|
+
|
421
|
+
|
422
|
+
<div id="validator-badges">
|
423
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
424
|
+
</div>
|
425
|
+
|
426
|
+
</body>
|
427
|
+
</html>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: uploader_upload.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>uploader_upload.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/active_record/acts/uploader_upload.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Fri May 22 14:54:46 -0600 2009</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if method_list -->
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="validator-badges">
|
97
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</body>
|
101
|
+
</html>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: exceptions.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>exceptions.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/uploader/exceptions.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Sat May 16 18:36:02 -0600 2009</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if method_list -->
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="validator-badges">
|
97
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</body>
|
101
|
+
</html>
|