提交 64462039 编写于 作者: X Xavier Noria

Merge pull request #5182 from castlerock/content_tag_instead_string

content_tag used instead string for option
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册