提交 9e1fb323 编写于 作者: D David Heinemeier Hansson

Handle empty cookie jars gracefully -- dont pout!

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@25 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 55af5952
......@@ -36,7 +36,7 @@ def initialize(controller)
# Returns the value of the cookie by +name+ -- or nil if no such cookie exist. You set new cookies using either the cookie method
# or cookies[]= (for simple name/value cookies without options).
def [](name)
@cookies[name.to_s].value if @cookies[name.to_s]
@cookies[name.to_s].value if @cookies.is_a?(Hash) && @cookies[name.to_s]
end
def []=(name, options)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册