title: How to make a PUT request from a Rails model to controller?
body: <p>I want to update model via PUT request in Rails app. What would be the best way to do that?</p>
  
  <p>Basically I have:</p>
  
  <pre><code>def method
    ...
    @relation = Relation.find(34)
    @relation.name = "new_name"
    @relation.save
  end
  </code></pre>
  
  <p>This gives me errors in SQLite ("cannot start a transaction within a transaction").</p>
  
  <p>Switching to put/post should I guess save the problem.. What would be the right way to do it?</p>