This repository has been archived by the owner. It is now read-only.
Permalink
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 = Asset.new(file: params[:file])
- @asset.save
- respond_with @asset
+ asset = Asset.new(file: params[:file])
+ asset.save
+
+ render json: asset
end
end

0 comments on commit 645a20f

Please sign in to comment.