Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

docs, flash message keys are normalized to strings. [ci skip]

This is a follow up to a668bef
  • Loading branch information...
commit f441ac7ddad917459b099c2cfafc27a3fa0ce466 1 parent 801e159
@senny senny authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 guides/source/
20 guides/source/
@@ -111,6 +111,26 @@ in your application, you can add an initializer file with the following content:
This would transparently migrate your existing `Marshal`-serialized cookies into the
new `JSON`-based format.
+### Flash structure changes
+Flash message keys are
+[normalized to strings]( They
+can still be accessed using either symbols or strings. Lopping through the flash
+will always yield string keys:
+flash["string"] = "a string"
+flash[:symbol] = "a symbol"
+# Rails < 4.1
+flash.keys # => ["string", :symbol]
+# Rails >= 4.1
+flash.keys # => ["string", "symbol"]
+Make sure you are comparing Flash message keys against strings.
### Changes in JSON handling
There are a few major changes related to JSON handling in Rails 4.1.
Please sign in to comment.
Something went wrong with that request. Please try again.