This repository has been archived by the owner. It is now read-only.
Browse files

Remove respond_to :json

Setting the `JackUp.Processor` path to `/assets.json` made it not include the
file in the params. Without the `.json`, it correctly saved the Asset record
with the attached file, but then returned a 406 "content not acceptable" error
since the controller only responds to JSON, and it was processed as HTML.

This way it accepts the HTML request and returns JSON to JackUp.
  • Loading branch information...
1 parent 63fdfba commit 645a20f2c40a878554fdd9ba60753fdb4115d08a Gabe Berke-Williams committed Nov 18, 2013
Showing with 4 additions and 5 deletions.
  1. +4 −5 spec/dummy/app/controllers/assets_controller.rb
@@ -1,9 +1,8 @@
class AssetsController < ApplicationController
- respond_to :json
def create
- @asset = params[:file])
- respond_with @asset
+ asset = params[:file])
+ render json: asset

0 comments on commit 645a20f

Please sign in to comment.