aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tag_helper.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-03-27 14:16:15 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-27 18:17:26 -0300
commit4f66586bbfacbce4c07f2b9d8d142be1bf6d4e5e (patch)
tree6c0a791e8b226d1b1e00e31d0eb3119347a0021c /actionpack/lib/action_view/helpers/tag_helper.rb
parent5f3726091851326d4976624db374a20d356b1630 (diff)
downloadrails-4f66586bbfacbce4c07f2b9d8d142be1bf6d4e5e.tar.gz
rails-4f66586bbfacbce4c07f2b9d8d142be1bf6d4e5e.tar.bz2
rails-4f66586bbfacbce4c07f2b9d8d142be1bf6d4e5e.zip
Merge pull request #5619 from jcoleman/textarea-newline-fix-breaks-haml
Textarea newline fix breaks haml (3-2-stable)
Diffstat (limited to 'actionpack/lib/action_view/helpers/tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index 8c33ef09fa..2b0dd96435 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -17,6 +17,10 @@ module ActionView
autofocus novalidate formnovalidate open pubdate).to_set
BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attribute| attribute.to_sym })
+ PRE_CONTENT_STRINGS = {
+ :textarea => "\n"
+ }
+
# Returns an empty HTML tag of type +name+ which by default is XHTML
# compliant. Set +open+ to true to create an open tag compatible
# with HTML 4.0 and below. Add HTML attributes by passing an attributes
@@ -125,7 +129,7 @@ module ActionView
def content_tag_string(name, content, options, escape = true)
tag_options = tag_options(options, escape) if options
- "<#{name}#{tag_options}>#{escape ? ERB::Util.h(content) : content}</#{name}>".html_safe
+ "<#{name}#{tag_options}>#{PRE_CONTENT_STRINGS[name.to_sym]}#{escape ? ERB::Util.h(content) : content}</#{name}>".html_safe
end
def tag_options(options, escape = true)