Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Streamline fragment_for SafeBuffer logic to make it more concise.

  • Loading branch information...
commit d12aa483f23fd32cd3f27be07ff259ee14424d3f 1 parent 81f7bf5
@cmeiklejohn cmeiklejohn authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 actionpack/lib/action_view/helpers/cache_helper.rb
View
9 actionpack/lib/action_view/helpers/cache_helper.rb
@@ -51,12 +51,9 @@ def fragment_for(name = {}, options = nil, &block) #:nodoc:
# This dance is needed because Builder can't use capture
pos = output_buffer.length
yield
- if output_buffer.is_a?(ActionView::OutputBuffer)
- safe_output_buffer = output_buffer.to_str
- fragment = safe_output_buffer.slice!(pos..-1)
- self.output_buffer = ActionView::OutputBuffer.new(safe_output_buffer)
- else
- fragment = output_buffer.slice!(pos..-1)
+ fragment = output_buffer.slice!(pos..-1)
+ if output_buffer.kind_of?(ActiveSupport::SafeBuffer)
+ self.output_buffer = output_buffer.html_safe
end
controller.write_fragment(name, fragment, options)
end
Please sign in to comment.
Something went wrong with that request. Please try again.