cfurrow
4/20/2014 - 10:48 PM

bullshit_controller.rb

$ 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=/
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