define(["app/app"], function(App) {
  "use strict";

  App.CreateAttachmentView = Ember.View.extend({
    tagName: 'input',
    type: 'file',
    attributeBindings: ['type'],

    change: function(event) {
      if (event.target.files.length > 0) {
        // Send the file object to controller
        var newFile = event.target.files[0]
        this.get('controller').send('addAttachment', newFile)

        // Clear the file input in DOM: 1) wrap with the form, 2) reset the form, 3) unwrap
        this.$().wrap('<form>').closest('form').get(0).reset()
        this.$().unwrap()
      }
    }
  })
})

@@ -135,16 +135,36 @@
 'file',%0A
+    multiple: true,%0A
     attr
@@ -185,16 +185,28 @@
  %5B'type'
+, 'multiple'
 %5D,%0A%0A    
@@ -305,16 +305,19 @@
 e object
+(s)
  to cont
@@ -342,16 +342,17 @@
  newFile
+s
  = event
@@ -368,12 +368,59 @@
 iles
-%5B0%5D%0A
+%0A        for (var i=0; i%3CnewFiles.length; i++) %7B%0A  
     
@@ -475,17 +475,31 @@
  newFile
-)
+s%5Bi%5D)%0A        %7D
 %0A%0A      

Enable multiple file upload for attachments