Skip to content

Instantly share code, notes, and snippets.

@cfurrow
Created April 20, 2014 22:48
Show Gist options
  • Save cfurrow/11127188 to your computer and use it in GitHub Desktop.
Save cfurrow/11127188 to your computer and use it in GitHub Desktop.
class BullshitController < ApplicationController
respond_to :json
def bullshit
bullshit = Bullshit.new
if bullshit.save
respond_with bullshit, status: :ok
else
respond_with bullshit, status: :unprocessable_entity
end
end
end
$ curl -I http://localhost:3000/bullshit
HTTP/1.1 422 Unprocessable Entity
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Ua-Compatible: chrome=1
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache
X-Request-Id: 83a3ad25-60b4-4421-ac93-56630803a71a
X-Runtime: 0.004175
Server: WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22)
Date: Sun, 20 Apr 2014 22:47:58 GMT
Content-Length: 0
Connection: Keep-Alive
Set-Cookie: request_method=HEAD; path=/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment