Skip to content

Commit

Permalink
Select tags with array options are deprecated, removing
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva authored and josevalim committed Sep 25, 2010
1 parent eb8a24a commit db57e92
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions actionpack/lib/action_view/helpers/form_tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ def form_tag(url_for_options = {}, options = {}, *parameters_for_url, &block)
# # => <select disabled="disabled" id="destination" name="destination"><option>NYC</option>
# # <option>Paris</option><option>Rome</option></select>
def select_tag(name, option_tags = nil, options = {})
if Array === option_tags
ActiveSupport::Deprecation.warn 'Passing an array of option_tags to select_tag implicitly joins them without marking them as HTML-safe. Pass option_tags.join.html_safe instead.', caller
end

html_name = (options[:multiple] == true && !name.to_s.ends_with?("[]")) ? "#{name}[]" : name
if blank = options.delete(:include_blank)
if blank.kind_of?(String)
Expand Down
6 changes: 0 additions & 6 deletions actionpack/test/template/form_tag_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ def test_select_tag_with_include_blank_with_string
assert_dom_equal expected, actual
end

def test_select_tag_with_array_options
assert_deprecated /array/ do
select_tag "people", ["<option>david</option>"]
end
end

def test_text_area_tag_size_string
actual = text_area_tag "body", "hello world", "size" => "20x40"
expected = %(<textarea cols="20" id="body" name="body" rows="40">hello world</textarea>)
Expand Down

0 comments on commit db57e92

Please sign in to comment.