title: Uploading with json causes missing template error
body: <p>I think <a href="http://www.dropzonejs.com/" rel="nofollow">dropzone.js</a>, is causing me a missing template error after I submit my form.</p>
  
  <p>In my coffeescript js file I have the setup for dropzone:</p>
  
  <pre><code>Dropzone.autoDiscover = false
  
  dropzone = new Dropzone('#item-form',
    maxFiles: 1
    maxFilesize: 1
    paramName: 'item[image]'
    headers: "X-CSRF-Token" : $('meta[name="csrf-token"]').attr('content')
    addRemoveLinks: true
    clickable: '#image-preview'
    previewsContainer: '#image-preview'
    thumbnailWidth: 200
    thumbnailHeight: 200
    parallelUploads: 100;
    autoProcessQueue: false
    uploadMultiple: false)
  
  $('#item-submit').click (e) -&gt;
    e.preventDefault()
    e.stopPropagation()
    if dropzone.getQueuedFiles().length &gt; 0
      dropzone.processQueue()
    else
      $('#item-form').submit()
    return
  return
  
  dropzone.on 'success', (file, responseText) -&gt;
    window.location.href = '/items/' + responseText.id
    return
  </code></pre>
  
  <p>Than I have my controller action, I want it to do this:</p>
  
  <pre><code>def create
      @item = current_user.items.build(item_params)
  
      respond_to do |format|
        if @item.save
          format.html { redirect_to @item }
          format.json { render :show, status: :created, location: @item }
        else
          format.html { render :new }
          format.json { render json: @item.errors, status: :unprocessable_entity }
        end
      end
    end
  </code></pre>
  
  <p>Than my form:</p>
  
  <pre><code>= form_for @item, validate: true, html: {id: 'item-form', class: 'form', multipart: true} do |f|
   = f.text_field :name, class: 'form-control'
  
      %main#image-preview
       Add a Photo
       .fallback
        = f.file_field :image, multiple: false
  
  = f.submit 'Done', id: 'item-submit'
  </code></pre>
  
  <p>So now this setup allows me to submit the form without any images but when it has an image and I submit the form. It will give me this error in the missing template error:</p>
  
  <pre><code>Started POST "/items" for 127.0.0.1 at 2015-10-14 03:35:29 -0700
  Processing by ItemsController#create as JSON
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"lZu8pjXdBY6wso5l1/B1lwgYDMkVmtRjCaPNBeK3uWy0mQItbv0bDaEZfujeEa2jt//S3qJ0f0fiWkIGC7uNFg==", "item"=&gt;{"name"=&gt;"dsdsds"es", "image"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x007f4779ccd748 @tempfile=#&lt;Tempfile:/tmp/RackMultipart20151014-2664-16b2m09.jpg&gt;, @original_filename="testimg.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"item[image]\"; filename=\"testimg.jpg\"\r\nContent-Type: image/jpeg\r\n"&gt;}, "null"=&gt;"", "commit"=&gt;"Done"}
    User Load (0.5ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id", 2]] 
  
     (46.1ms)  COMMIT
    Item Store (158.4ms)  {"id":29}
  Completed 406 Not Acceptable in 2115ms (Searchkick: 158.4ms | ActiveRecord: 47.7ms)
  
  ActionView::MissingTemplate - Missing template items/show, application/show with {:locale=&gt;[:en], :formats=&gt;[:json], :variants=&gt;[], :handlers=&gt;[:erb, :builder, :raw, :ruby, :coffee, :arb, :haml, :jbuilder]}. Searched in:
  ...............
  </code></pre>
  
  <p>So I'm guessing I have to make a <code>json</code> file? But I don't know what that means or the setup you use. Can someone help me?</p>