mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #5182 from castlerock/content_tag_instead_string
content_tag used instead string for option
This commit is contained in:
commit
64462039c0
1 changed files with 2 additions and 2 deletions
|
@ -122,11 +122,11 @@ module ActionView
|
||||||
html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name
|
html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name
|
||||||
|
|
||||||
if options.delete(:include_blank)
|
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
|
end
|
||||||
|
|
||||||
if prompt = options.delete(:prompt)
|
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
|
end
|
||||||
|
|
||||||
content_tag :select, option_tags, { "name" => html_name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
|
content_tag :select, option_tags, { "name" => html_name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
|
||||||
|
|
Loading…
Reference in a new issue