Permalink
Browse files

Merge pull request #5182 from castlerock/content_tag_instead_string

content_tag used instead string for option
  • Loading branch information...
2 parents 174cf8b + a37c474 commit 64462039c01329e8d43f7ffb9076cecbc430a8e6 @fxn fxn committed Apr 5, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -122,11 +122,11 @@ def select_tag(name, option_tags = nil, options = {})
html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name
if options.delete(:include_blank)
- option_tags = "<option value=\"\"></option>".html_safe + option_tags
+ option_tags = content_tag(:option, '', :value => '').safe_concat(option_tags)
end
if prompt = options.delete(:prompt)
- option_tags = "<option value=\"\">#{prompt}</option>".html_safe + option_tags
+ option_tags = content_tag(:option, prompt, :value => '').safe_concat(option_tags)
end
content_tag :select, option_tags, { "name" => html_name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)

0 comments on commit 6446203

Please sign in to comment.