0
我想通過Rails應用程序中的PUT請求更新模型。什麼是最好的方式來做到這一點?如何從Rails模型向控制器發出PUT請求?
基本上我有:
def method
...
@relation = Relation.find(34)
@relation.name = "new_name"
@relation.save
end
這讓我在SQLite的錯誤(「不能在事務內啓動一個事務」)。
切換到put/post我應該保存問題..什麼是正確的方法來做到這一點?
這種方法在模型中嗎?我沒有看到任何嘗試提出任何請求。 –
這是一個後臺工作者的方法。 – Stpn
我仍然沒有看到這與get/put/post請求有關。 –