diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-07-01 12:55:19 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-07-01 12:55:19 -0700 |
commit | e7312105c73c20b286ebf17b16808001803e2c61 (patch) | |
tree | 3e23282353ffa6e6fc1ca53afc2e0b35f51a6274 /actionpack/lib/action_view/helpers/form_tag_helper.rb | |
parent | 54f48517708d16e92bfc6bab6255f6299ca80af0 (diff) | |
parent | 1026d7706ffb467eac3cee8142d964bc2d30baa8 (diff) | |
download | rails-e7312105c73c20b286ebf17b16808001803e2c61.tar.gz rails-e7312105c73c20b286ebf17b16808001803e2c61.tar.bz2 rails-e7312105c73c20b286ebf17b16808001803e2c61.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_tag_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_tag_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 8ab78e7bc6..ca6ba501e2 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -231,6 +231,8 @@ module ActionView # * <tt>:rows</tt> - Specify the number of rows in the textarea # * <tt>:cols</tt> - Specify the number of columns in the textarea # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input. + # * <tt>:escape</tt> - By default, the contents of the text input are HTML escaped. + # If you need unescaped contents, set this to false. # * Any other key creates standard HTML attributes for the tag. # # ==== Examples @@ -258,6 +260,9 @@ module ActionView options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split) end + escape = options.key?("escape") ? options.delete("escape") : true + content = html_escape(content) if escape + content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys) end |