Skip to content

Commit

Permalink
Merge pull request rails#5190 from rafaelfranca/fix-393-3-2-stable
Browse files Browse the repository at this point in the history
[3-2-stable] Add a new line after the textarea opening tag.
  • Loading branch information
tenderlove committed Feb 27, 2012
2 parents b543f8f + 2b4e7a7 commit 210c33f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -1072,7 +1072,7 @@ def to_text_area_tag(options = {})
options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
end

content_tag("textarea", ERB::Util.html_escape(options.delete('value') || value_before_type_cast(object)), options)
content_tag("textarea", "\n#{options.delete('value') || value_before_type_cast(object)}", options)
end

def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/template/active_model_helper_test.rb
Expand Up @@ -29,7 +29,7 @@ def setup

def test_text_area_with_errors
assert_dom_equal(
%(<div class="field_with_errors"><textarea cols="40" id="post_body" name="post[body]" rows="20">Back to the hill and over it again!</textarea></div>),
%(<div class="field_with_errors"><textarea cols="40" id="post_body" name="post[body]" rows="20">\nBack to the hill and over it again!</textarea></div>),
text_area("post", "body")
)
end
Expand Down

0 comments on commit 210c33f

Please sign in to comment.