Skip to content

Commit

Permalink
use content_tag instead strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nashby committed Feb 25, 2012
1 parent eecb086 commit 2bc879a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions actionpack/lib/action_view/helpers/tags/base.rb
Expand Up @@ -133,13 +133,14 @@ def select_content_tag(option_tags, options, html_options)

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
Expand Down

0 comments on commit 2bc879a

Please sign in to comment.