diff options
author | Vasiliy Ermolovich <younash@gmail.com> | 2012-02-25 21:05:33 +0300 |
---|---|---|
committer | Vasiliy Ermolovich <younash@gmail.com> | 2012-02-25 21:05:33 +0300 |
commit | 2bc879a43d1b7b97de871d993d1bd63414e83677 (patch) | |
tree | 960da837e8cc327ba686c48c103f1505b7374016 /actionpack/lib | |
parent | eecb086a8d6b3e8903ccf9d7344f84ec8fb75df2 (diff) | |
download | rails-2bc879a43d1b7b97de871d993d1bd63414e83677.tar.gz rails-2bc879a43d1b7b97de871d993d1bd63414e83677.tar.bz2 rails-2bc879a43d1b7b97de871d993d1bd63414e83677.zip |
use content_tag instead strings
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/base.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionpack/lib/action_view/helpers/tags/base.rb index d949ff5194..c9c891daa1 100644 --- a/actionpack/lib/action_view/helpers/tags/base.rb +++ b/actionpack/lib/action_view/helpers/tags/base.rb @@ -133,13 +133,14 @@ module ActionView def add_options(option_tags, options, value = nil) if options[:include_blank] - option_tags = "<option value=\"\">#{ERB::Util.html_escape(options[:include_blank]) if options[:include_blank].kind_of?(String)}</option>\n" + option_tags + include_blank = options[:include_blank] if options[:include_blank].kind_of?(String) + option_tags = content_tag(:option, include_blank, :value => '').safe_concat("\n").safe_concat(option_tags) end if value.blank? && options[:prompt] prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select') - option_tags = "<option value=\"\">#{ERB::Util.html_escape(prompt)}</option>\n" + option_tags + option_tags = content_tag(:option, prompt, :value => '').safe_concat("\n").safe_concat(option_tags) end - option_tags.html_safe + option_tags end end end |