title: completed 401 unauthorized devise ability
body: <p>I can not get create response for current_patient. Getting response 401 unauthorized. I have tried updating the ability file.</p>
  
  <p>responses_controller.rb:</p>
  
  <pre><code> def create
     @reply = Response.create(params[:response])
     office = ""
     if current_user
       office = current_user.office || current_user.account.offices.first
     elsif current_patient
       office = current_patient.office_id
     end
  
     ...........
  
   end
  </code></pre>
  
  <p>Ability file:</p>
  
  <pre><code>def patient
   can :create, Response, :patient_id =&gt; @patient.id
  end
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>Started POST "/responses" for 127.0.0.1 at 2014-11-20 17:35:45 -0500
   Processing by ResponsesController#create as JS
   Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"blah_blah_blah", "response"=&gt;{"review_id"=&gt;"", "date"=&gt;"2014-11-20 17:35:40 -0500", "patient_id"=&gt;"13", "message"=&gt;"Howdy neighbor!"}, "commit"=&gt;"Submit Reply"}
  Completed 401 Unauthorized in 166ms
  </code></pre>