Skip to content

Commit

Permalink
✂️
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Oct 25, 2014
1 parent 0afbe74 commit f28340a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions actionview/lib/action_view/helpers/form_tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,12 @@ def select_tag(name, option_tags = nil, options = {})
option_tags ||= ""
html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name


if options.include?(:include_blank)
include_blank = options.delete(:include_blank)
if include_blank == true
include_blank = ''
end

option_tags = content_tag(:option, include_blank, :value => '').safe_concat(option_tags)
end

Expand Down
2 changes: 1 addition & 1 deletion actionview/test/template/form_tag_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def test_select_tag_with_include_blank
expected = %(<select id="places" name="places"><option value=""></option><option>Home</option><option>Work</option><option>Pub</option></select>)
assert_dom_equal expected, actual
end

def test_select_tag_with_include_blank_string
actual = select_tag "places", "<option>Home</option><option>Work</option><option>Pub</option>".html_safe, :include_blank => 'Choose'
expected = %(<select id="places" name="places"><option value="">Choose</option><option>Home</option><option>Work</option><option>Pub</option></select>)
Expand Down

0 comments on commit f28340a

Please sign in to comment.