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

Commit acd38f7

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

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,21 @@ 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-
==========================================================
61+
Example 2: Uploading the files for a has_many relationship with accepts_nested_attributes_for
62+
=============================================================================================
6363
Consider the common case of an Album which has_many Photos.
6464

65-
In your form, you can use:
65+
In your form for an album, you can use:
6666

67-
<%= plupload(@print_production_form, :print_production_files, options={:plupload_container=>'uploader', :pluploader=>true, :field_name=>'album[photos][][payload]'}) %>
67+
<%= plupload(@album, :photos, options={:plupload_container=>'uploader', :pluploader=>true, :field_name=>'album[photos][][payload]'}) %>
6868
<div id="uploader" name="uploader" style="width: 100%;"></div>
6969

7070

7171
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`.
7272

7373

74+
75+
76+
7477
Copyright (c) 2011 [Sammy Larbi](http://www.codeodor.com), released under the MIT license
7578
(with Plupload and it's components using other licenses -- see LICENSE file)

0 commit comments

Comments
 (0)