Changeset 6652
- Timestamp:
- 05/02/07 22:30:41 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/tag_helper.rb (modified) (2 diffs)
- trunk/actionpack/test/template/tag_helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r6649 r6652 1 1 *SVN* 2 3 * Fixed that content_tag with a block will just return the result instead of concate it if not used in a ERb view #7857, #7432 [michael.niessner] 2 4 3 5 * Replace the current block/continuation filter chain handling by an implementation based on a simple loop. #8226 [Stefan Kaes] trunk/actionpack/lib/action_view/helpers/tag_helper.rb
r5857 r6652 49 49 options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash) 50 50 content = capture(&block) 51 concat(content_tag_string(name, content, options), block.binding) 51 content_tag = content_tag_string(name, content, options) 52 block_is_within_action_view?(block) ? concat(content_tag, block.binding) : content_tag 52 53 else 53 54 content = content_or_options_with_block … … 99 100 escaped.gsub(/&([a-z]+|(#\d+));/i) { "&#{$1};" } 100 101 end 102 103 def block_is_within_action_view?(block) 104 eval("defined? _erbout", block.binding) 105 end 101 106 end 102 107 end trunk/actionpack/test/template/tag_helper_test.rb
r6057 r6652 48 48 end 49 49 50 def test_content_tag_with_block_and_options_outside_of_action_view 51 assert_equal content_tag("a", "Create", :href => "create"), 52 content_tag("a", "href" => "create") { "Create" } 53 end 54 50 55 def test_cdata_section 51 56 assert_equal "<![CDATA[<hello world>]]>", cdata_section("<hello world>")