title: Edit photo after it's been uploaded
body: <p>I'm using the jQuery File Upload plugin (documentation <a href="https://github.com/blueimp/jQuery-File-Upload/" rel="nofollow">here</a>) integrated into my Rails 3.2.1 app (set up based on documentation <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Rails-setup-for-V6-%28multiple%29" rel="nofollow">here</a>) to upload photos into my app.</p>
  
  <p>I've set up the plugin so that it automatically uploads all the files that have been selected without the user having to do anything else. Once the photos have been uploaded (and the according entries created in the DB), I'd like the user to be able to enter a title for each of the photos.</p>
  
  <p>However, in the template script that displays the uploaded photos, I'm struggling to create an edit form for each of the photos that have been uploaded. I know creating a form for each photo is far from elegant, but it appears to be the only way in this context (unless I'm missing something obvious here?).</p>
  
  <pre><code>&lt;script id="template-download" type="text/html"&gt;
      {% for (var i=0, files=o.files, l=files.length, file=files[0]; i&lt;l; file=files[++i]) { %}
              &lt;div class="template-download nofade"&gt;
                  {% if (file.error) { %}
                      {%=file.name%}
                      &lt;span&gt;{%=fileUploadErrors[file.error] || file.error%}&lt;/span&gt;
                  {% } else { %}
                      {% if (file.thumbnail_url) { %}
                          &lt;a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"&gt;&lt;img src="{%=file.mini_url%}"&gt;&lt;/a&gt;
                          &lt;%= form_for Photo.find(&lt;---- ID SHOULD BE HERE ----&gt;) do |f| %&gt;
                              &lt;%= f.text_field :title %&gt;
                              &lt;button class="btn btn-danger btn-small" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"&gt;&lt;i class="icon-white icon-trash"&gt;&lt;/i&gt; Delete&lt;/button&gt;
                              &lt;%= f.submit %&gt;
                          &lt;% end %&gt;
                      {% } %}
                  {% } %}
              &lt;/div&gt;
      {% } %}
  &lt;/script&gt;
  </code></pre>
  
  <p>I have a variable which is</p>
  
  <pre><code>file.photo_id
  </code></pre>
  
  <p>that contains the ID of the relevant photo, but trying to create a form for it from</p>
  
  <pre><code>&lt;%= form_for Photo.find("{%= file.photo_id %}") do |f| %&gt;
  </code></pre>
  
  <p>only returns this error:</p>
  
  <pre><code>Couldn't find Photo with id={%= file.photo_id %}
  </code></pre>
  
  <p>I've tried variations like Photo.find({%= file.photo_id %}) too, but to no avail.</p>
  
  <p>I know this is quite a specific problem to a specific plugin, but thought it might still be worth asking. Anyone know how to pass in the photo ID, or even better has hints of how to solve this problem in a more elegant manner?</p>