Permalink
Browse files

Fixed that fragment caching should return a cache hit as html_safe (o…

…r it would all just get escaped) [DHH]
  • Loading branch information...
1 parent 0dbe0f6 commit 45e192d05c4ffe57ec74f1e79f5a85e3d0d0ea03 @dhh dhh committed Jan 8, 2010
Showing with 3 additions and 1 deletion.
  1. +2 −0 actionpack/CHANGELOG
  2. +1 −1 actionpack/lib/action_controller/caching/fragments.rb
View
@@ -1,5 +1,7 @@
*Edge*
+* Fixed that fragment caching should return a cache hit as html_safe (or it would all just get escaped) [DHH]
+
* Added :alert, :notice, and :flash as options to ActionController::Base#redirect_to that'll automatically set the proper flash before the redirection [DHH]. Examples:
flash[:notice] = 'Post was created'
@@ -37,7 +37,7 @@ def fragment_cache_key(key)
def fragment_for(buffer, name = {}, options = nil, &block) #:nodoc:
if perform_caching
if cache = read_fragment(name, options)
- buffer.concat(cache)
+ buffer.concat(cache.html_safe!)
else
pos = buffer.length
block.call

0 comments on commit 45e192d

Please sign in to comment.