Skip to content
This repository was archived by the owner on Jan 26, 2025. It is now read-only.

Commit c7160c1

Browse files
committed
Edited README.md via GitHub
1 parent 4fa0fe3 commit c7160c1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ Then if you're storing it in the DB, you let it continue on to
5858
@library_file = LibraryFile.new(params[:library_file])
5959

6060

61+
Example 2: Uploading the files for a has_many relationship
62+
==========================================================
63+
Consider the common case of an Album which has_many Photos.
64+
65+
In your form, you can use:
66+
67+
<%= plupload(@print_production_form, :print_production_files, options={:plupload_container=>'uploader', :pluploader=>true, :field_name=>'album[photos][][payload]'}) %>
68+
<div id="uploader" name="uploader" style="width: 100%;"></div>
69+
70+
71+
What this does is tells the plugin to use the pluploader (which needs a route: `match 'plupload_rails/_plupload_uploader', :controller=>'plupload_rails', :action=>'_plupload_uploader', :as=>'pluploader'`) and tells it what to name the field - in this case the Album `has_many` Photos, and the method we want on photo is called `payload`.
6172

6273

6374
Copyright (c) 2011 [Sammy Larbi](http://www.codeodor.com), released under the MIT license

0 commit comments

Comments
 (0)