I want to update model via PUT request in Rails app. What would be the best way to do that?
Basically I have:
def method
...
@relation = Relation.find(34)
@relation.name = "new_name"
@relation.save
end
This gives me errors in SQLite (“cannot start a transaction within a transaction”).
Switching to put/post should I guess save the problem.. What would be the right way to do it?
So after some time, I actually found the solution. Here is the code for the Resque worker, that updates the Relation model via PUT. Using this method I don’t get SQLite busy exception errors.
Maybe that will be useful to someone.