From 177cae5483736e20bc8b1f878a4f1a52eed26a10 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 26 Nov 2004 02:11:42 +0000 Subject: Allow symbols to be used as names for setting cookies git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@22 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/cookies.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index d56096818d..b23bb74f88 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -36,13 +36,13 @@ module ActionController #:nodoc: # 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].value if @cookies[name] + @cookies[name.to_s].value if @cookies[name.to_s] end def []=(name, options) if options.is_a?(Hash) options.each { |key, value| options[key.to_s] = value } - options["name"] = name + options["name"] = name.to_s else options = [ name, options ] end -- cgit v1.2.3