Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

flash doesn't pass objects #15522 [ci skip]

  • Loading branch information...
commit 59ad995ff9e17a486d46bd0d3f83fac3f8a626eb 1 parent 7bd6206
@nishantmodak nishantmodak authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 actionpack/lib/action_dispatch/middleware/flash.rb
View
9 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -10,7 +10,7 @@ def flash
end
end
- # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed
+ # The flash provides a way to pass temporary primitive-types (String, Array, Hash) between actions. Anything you place in the flash will be exposed
# to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create
# action that sets <tt>flash[:notice] = "Post successfully created"</tt> before redirecting to a display action that can
# then expose the flash to its template. Actually, that exposure is automatically done.
@@ -37,8 +37,11 @@ def flash
# flash.alert = "You must be logged in"
# flash.notice = "Post successfully created"
#
- # This example just places a string in the flash, but you can put any object in there. And of course, you can put as
- # many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
+ # This example places a string in the flash. And of course, you can put as many as you like at a time too. If you want to pass
+ # non-primitive types, you will have to handle that in your application. Example: To show messages with links, you will have to
+ # use sanitize helper.
+ #
+ # Just remember: They'll be gone by the time the next action has been performed.
#
# See docs on the FlashHash class for more details about the flash.
class Flash
Please sign in to comment.
Something went wrong with that request. Please try again.