Rails Rails 4 + simple_form 遇到问题了

mjf429 · May 12, 2013 · Last by mjf429 replied at May 12, 2013 · 3015 hits

发现在 edit 的 form 里_method 变成了"patch",在 rails 3 里的时候是 put,然后结果就是没有办法去更新对象,请问谁知道怎么解决

手动指定 method

#1 楼 @doitian 找到问题了。。。rails 4 里 generate 出来的 update 方法更新属性使用的是 update,而 mongoid 需要 update_attributes

You need to Sign in before reply, if you don't have an account, please Sign up first.