rails 2.3.4 有一个bug , 自动产生代码后, (scaffold),show 内容报错
undefined method `^' for "7":String
Ruby19\lib\ruby\gems\1.9.1\gems\activesupport-2.3.4\lib\active_support\message_verifier.rb
patch 方法: 直接替换函数为patch里面的函数
def secure_compare(a, b)
result = a.length ^ b.length
for i in 0..([a.length, b.length].max - 1)
result |= a[i].to_i ^ b[i].to_i
end
result == 0
end
undefined method `^' for "7":String
Ruby19\lib\ruby\gems\1.9.1\gems\activesupport-2.3.4\lib\active_support\message_verifier.rb
patch 方法: 直接替换函数为patch里面的函数
def secure_compare(a, b)
result = a.length ^ b.length
for i in 0..([a.length, b.length].max - 1)
result |= a[i].to_i ^ b[i].to_i
end
result == 0
end
本文介绍了一个存在于Rails 2.3.4版本中的bug,该bug会导致使用scaffold生成的show页面出现错误。文中详细描述了错误的表现形式及原因,并提供了一种可行的解决方案。
404

被折叠的 条评论
为什么被折叠?



