Skip to content

Commit

Permalink
content_tag used instead string for option
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishnu Atrai committed Feb 26, 2012
1 parent 74bc920 commit a37c474
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -114,11 +114,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)
Expand Down

0 comments on commit a37c474

Please sign in to comment.