title: Rails4 "status":"422","error":"Unprocessable Entity"
body: <p>I want to add some data from the mobile app to my rails app using Json, It working fine, if I use the GET method but when I set it with POST method it give error "status":"422","error":"Unprocessable Entity".</p>
  
  <p> The route is</p>
  
  <pre><code>resources :photomsgs, :defaults =&gt; { :format =&gt; 'json' }
  </code></pre>
  
  <p>My Controller is</p> 
  
  <pre><code>def create
    @photomsg = Photomsg.new(photo_params)
  
   respond_to do |format|
    if @photomsg.save
      format.json { render json: @photomsg, status: :created }
      format.xml { render xml: @photomsg, status: :created }
    else
      format.json { render json: @photomsg.errors, status: :unprocessable_entity }
      format.xml { render xml: @photomsg.errors, status: :unprocessable_entity }
    end
  end
  end 
  
    def photo_params
      params.require(:photomsg).permit(:title, :physician, :patient)
    end
  </code></pre>
  
  <p>I am using this Json url - http://infinite-depths-5848.herokuapp.com/photomsgs</p>