The following page successfully uses ajax and jquery-file-uploader to upload an image:

```
<%= javascript_include_tag "/assets/jquery.js" %>
<%= javascript_include_tag "/assets/jquery_ujs.js" %>
<%= javascript_include_tag "/assets/jquery-fileupload/jquery.iframe-transport.js" %>
<%= javascript_include_tag "/assets/jquery-fileupload/jquery.fileupload.js" %>
<%= javascript_include_tag "/assets/jquery-fileupload/basic.js" %>
<%= javascript_include_tag "/assets/jquery-fileupload/vendor/tmpl.js" %>
<%= javascript_include_tag "/assets/profiles.js" %>

<%= form_for @profile, :html => {:id => "the_form", :multipart => true}, 
    :authenticity_token => true, remote: true  do |f| %>
         <%= f.file_field :pic,  :id => "filer", :multiple => true %>
<% end %>

```

However, I am now trying to render the form via ajax. So a user goes to the page, clicks on a button that says "display form", and ajax renders the form on the page. When I do this, the form no longer works. When someone selects a file, the server doesn't do anything. I tried adding a submit button, but then for some weird reason the request is submitted as html and not with ajax. How do I get jquery-file-uploader to work with the ajax rendered form?

Here is the coffee script file being called by the final javascript\_include\_tag:

```
jQuery ->
  $('#the_form').fileupload
    dataType: "script"

```