aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/cookies.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 1453bd9704..e5162a4995 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed to_input_field_tag so it no longer explicitly uses InstanceTag.value if value was specified in the options hash [evl]
+
* Added the possibility of having validate be protected for assert_(in)valid_column #263 [Tobias Luetke]
* Added that ActiveRecordHelper#form now calls url_for on the :action option.
diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb
index 924dc714b1..80ee617987 100644
--- a/actionpack/lib/action_controller/cookies.rb
+++ b/actionpack/lib/action_controller/cookies.rb
@@ -36,7 +36,7 @@ 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.to_s].value if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value)
+ @cookies[name.to_s].value.first if @cookies[name.to_s] && @cookies[name.to_s].respond_to?(:value)
end
def []=(name, options)
@@ -49,6 +49,11 @@ module ActionController #:nodoc:
set_cookie(name, options)
end
+
+ # Removes the cookie on the client machine by setting the value to an empty string.
+ def delete(name)
+ set_cookie(name, "value" => "")
+ end
private
def set_cookie(name, options) #:doc: