diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-16 11:43:04 -0700 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-16 11:43:04 -0700 |
commit | c61ed70b00c93bdf42c7538a334f07e58c60bc4e (patch) | |
tree | aaa304345983bafd88b1860b5bf63da1271e690e /actionpack/lib/action_view/helpers | |
parent | 67d8b9743add53f908ca417c641c4a54dd326c7d (diff) | |
download | rails-c61ed70b00c93bdf42c7538a334f07e58c60bc4e.tar.gz rails-c61ed70b00c93bdf42c7538a334f07e58c60bc4e.tar.bz2 rails-c61ed70b00c93bdf42c7538a334f07e58c60bc4e.zip |
Some more tweaks on <% %>.
* The cache helper is now semantically "mark this region for caching"
* As a result, <% x = cache do %> no longer works
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/cache_helper.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/cache_helper.rb b/actionpack/lib/action_view/helpers/cache_helper.rb index 3729d7daa8..f5c2127d3f 100644 --- a/actionpack/lib/action_view/helpers/cache_helper.rb +++ b/actionpack/lib/action_view/helpers/cache_helper.rb @@ -32,7 +32,8 @@ module ActionView # <i>Topics listed alphabetically</i> # <% end %> def cache(name = {}, options = nil, &block) - controller.fragment_for(name, options, &block) + safe_concat controller.fragment_for(name, options, &block) + nil end end end diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index b19a9754f4..b5bf813e07 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -29,7 +29,7 @@ module ActionView end def safe_concat(string) - output_buffer.safe_concat(string) + output_buffer.respond_to?(:safe_concat) ? output_buffer.safe_concat(string) : concat(string) end # Truncates a given +text+ after a given <tt>:length</tt> if +text+ is longer than <tt>:length</tt> |