Skip to content
This repository
Browse code

Fixes #5324 by removing default size options from input:text and defa…

…ult cols and rows options from textarea.
  • Loading branch information...
commit 3384ee24adb1ac38fdadbb755523ffb9f6bda9cc 1 parent 3e77649
Philip Arndt parndt authored
30 actionpack/lib/action_view/helpers/form_helper.rb
@@ -45,10 +45,10 @@ module Helpers
45 45 # <input name="authenticity_token" type="hidden" value="NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=" />
46 46 # </div>
47 47 # <label for="person_first_name">First name</label>:
48   - # <input id="person_first_name" name="person[first_name]" size="30" type="text" /><br />
  48 + # <input id="person_first_name" name="person[first_name]" type="text" /><br />
49 49 #
50 50 # <label for="person_last_name">Last name</label>:
51   - # <input id="person_last_name" name="person[last_name]" size="30" type="text" /><br />
  51 + # <input id="person_last_name" name="person[last_name]" type="text" /><br />
52 52 #
53 53 # <input name="commit" type="submit" value="Create Person" />
54 54 # </form>
@@ -76,10 +76,10 @@ module Helpers
76 76 # <input name="authenticity_token" type="hidden" value="NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=" />
77 77 # </div>
78 78 # <label for="person_first_name">First name</label>:
79   - # <input id="person_first_name" name="person[first_name]" size="30" type="text" value="John" /><br />
  79 + # <input id="person_first_name" name="person[first_name]" type="text" value="John" /><br />
80 80 #
81 81 # <label for="person_last_name">Last name</label>:
82   - # <input id="person_last_name" name="person[last_name]" size="30" type="text" value="Smith" /><br />
  82 + # <input id="person_last_name" name="person[last_name]" type="text" value="Smith" /><br />
83 83 #
84 84 # <input name="commit" type="submit" value="Update Person" />
85 85 # </form>
@@ -757,7 +757,7 @@ def file_field(object_name, method, options = {})
757 757 # # </textarea>
758 758 #
759 759 # text_area(:application, :notes, :cols => 40, :rows => 15, :class => 'app_input')
760   - # # => <textarea cols="40" rows="15" id="application_notes" name="application[notes]" class="app_input">
  760 + # # => <textarea rows="15" id="application_notes" name="application[notes]" class="app_input">
761 761 # # #{@application.notes}
762 762 # # </textarea>
763 763 #
@@ -860,20 +860,20 @@ def radio_button(object_name, method, tag_value, options = {})
860 860 # ==== Examples
861 861 #
862 862 # search_field(:user, :name)
863   - # # => <input id="user_name" name="user[name]" size="30" type="search" />
  863 + # # => <input id="user_name" name="user[name]" type="search" />
864 864 # search_field(:user, :name, :autosave => false)
865   - # # => <input autosave="false" id="user_name" name="user[name]" size="30" type="search" />
  865 + # # => <input autosave="false" id="user_name" name="user[name]" type="search" />
866 866 # search_field(:user, :name, :results => 3)
867   - # # => <input id="user_name" name="user[name]" results="3" size="30" type="search" />
  867 + # # => <input id="user_name" name="user[name]" results="3" type="search" />
868 868 # # Assume request.host returns "www.example.com"
869 869 # search_field(:user, :name, :autosave => true)
870   - # # => <input autosave="com.example.www" id="user_name" name="user[name]" results="10" size="30" type="search" />
  870 + # # => <input autosave="com.example.www" id="user_name" name="user[name]" results="10" type="search" />
871 871 # search_field(:user, :name, :onsearch => true)
872   - # # => <input id="user_name" incremental="true" name="user[name]" onsearch="true" size="30" type="search" />
  872 + # # => <input id="user_name" incremental="true" name="user[name]" onsearch="true" type="search" />
873 873 # search_field(:user, :name, :autosave => false, :onsearch => true)
874   - # # => <input autosave="false" id="user_name" incremental="true" name="user[name]" onsearch="true" size="30" type="search" />
  874 + # # => <input autosave="false" id="user_name" incremental="true" name="user[name]" onsearch="true" type="search" />
875 875 # search_field(:user, :name, :autosave => true, :onsearch => true)
876   - # # => <input autosave="com.example.www" id="user_name" incremental="true" name="user[name]" onsearch="true" results="10" size="30" type="search" />
  876 + # # => <input autosave="com.example.www" id="user_name" incremental="true" name="user[name]" onsearch="true" results="10" type="search" />
877 877 #
878 878 def search_field(object_name, method, options = {})
879 879 Tags::SearchField.new(object_name, method, self, options).render
@@ -882,7 +882,7 @@ def search_field(object_name, method, options = {})
882 882 # Returns a text_field of type "tel".
883 883 #
884 884 # telephone_field("user", "phone")
885   - # # => <input id="user_phone" name="user[phone]" size="30" type="tel" />
  885 + # # => <input id="user_phone" name="user[phone]" type="tel" />
886 886 #
887 887 def telephone_field(object_name, method, options = {})
888 888 Tags::TelField.new(object_name, method, self, options).render
@@ -910,7 +910,7 @@ def date_field(object_name, method, options = {})
910 910 # Returns a text_field of type "url".
911 911 #
912 912 # url_field("user", "homepage")
913   - # # => <input id="user_homepage" size="30" name="user[homepage]" type="url" />
  913 + # # => <input id="user_homepage" name="user[homepage]" type="url" />
914 914 #
915 915 def url_field(object_name, method, options = {})
916 916 Tags::UrlField.new(object_name, method, self, options).render
@@ -919,7 +919,7 @@ def url_field(object_name, method, options = {})
919 919 # Returns a text_field of type "email".
920 920 #
921 921 # email_field("user", "address")
922   - # # => <input id="user_address" size="30" name="user[address]" type="email" />
  922 + # # => <input id="user_address" name="user[address]" type="email" />
923 923 #
924 924 def email_field(object_name, method, options = {})
925 925 Tags::EmailField.new(object_name, method, self, options).render
2  actionpack/lib/action_view/helpers/tags/base.rb
@@ -5,8 +5,6 @@ class Base #:nodoc:
5 5 include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper
6 6 include FormOptionsHelper
7 7
8   - DEFAULT_FIELD_OPTIONS = { "size" => 30 }
9   -
10 8 attr_reader :object
11 9
12 10 def initialize(object_name, method_name, template_object, options = {})
4 actionpack/lib/action_view/helpers/tags/text_area.rb
@@ -2,10 +2,8 @@ module ActionView
2 2 module Helpers
3 3 module Tags
4 4 class TextArea < Base #:nodoc:
5   - DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 40, "rows" => 20 }
6   -
7 5 def render
8   - options = DEFAULT_TEXT_AREA_OPTIONS.merge(@options.stringify_keys)
  6 + options = @options.stringify_keys
9 7 add_default_name_and_id(options)
10 8
11 9 if size = options.delete("size")
3  actionpack/lib/action_view/helpers/tags/text_field.rb
@@ -4,8 +4,7 @@ module Tags
4 4 class TextField < Base #:nodoc:
5 5 def render
6 6 options = @options.stringify_keys
7   - options["size"] = options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"] unless options.key?("size")
8   - options = DEFAULT_FIELD_OPTIONS.merge(options)
  7 + options["size"] = options["maxlength"] unless options.key?("size")
9 8 options["type"] ||= field_type
10 9 options["value"] = options.fetch("value"){ value_before_type_cast(object) } unless field_type == "file"
11 10 options["value"] &&= ERB::Util.html_escape(options["value"])
6 actionpack/test/template/active_model_helper_test.rb
@@ -29,14 +29,14 @@ def setup
29 29
30 30 def test_text_area_with_errors
31 31 assert_dom_equal(
32   - %(<div class="field_with_errors"><textarea cols="40" id="post_body" name="post[body]" rows="20">\nBack to the hill and over it again!</textarea></div>),
  32 + %(<div class="field_with_errors"><textarea id="post_body" name="post[body]">\nBack to the hill and over it again!</textarea></div>),
33 33 text_area("post", "body")
34 34 )
35 35 end
36 36
37 37 def test_text_field_with_errors
38 38 assert_dom_equal(
39   - %(<div class="field_with_errors"><input id="post_author_name" name="post[author_name]" size="30" type="text" value="" /></div>),
  39 + %(<div class="field_with_errors"><input id="post_author_name" name="post[author_name]" type="text" value="" /></div>),
40 40 text_field("post", "author_name")
41 41 )
42 42 end
@@ -76,7 +76,7 @@ def test_field_error_proc
76 76 end
77 77
78 78 assert_dom_equal(
79   - %(<div class="field_with_errors"><input id="post_author_name" name="post[author_name]" size="30" type="text" value="" /> <span class="error">can't be empty</span></div>),
  79 + %(<div class="field_with_errors"><input id="post_author_name" name="post[author_name]" type="text" value="" /> <span class="error">can't be empty</span></div>),
80 80 text_field("post", "author_name")
81 81 )
82 82 ensure
324 actionpack/test/template/form_helper_test.rb
@@ -249,35 +249,35 @@ def test_label_with_block_and_options
249 249 end
250 250
251 251 def test_label_with_block_in_erb
252   - assert_equal "<label for=\"post_message\">\n Message\n <input id=\"post_message\" name=\"post[message]\" size=\"30\" type=\"text\" />\n</label>", view.render("test/label_with_block")
  252 + assert_equal "<label for=\"post_message\">\n Message\n <input id=\"post_message\" name=\"post[message]\" type=\"text\" />\n</label>", view.render("test/label_with_block")
253 253 end
254 254
255 255 def test_text_field
256 256 assert_dom_equal(
257   - '<input id="post_title" name="post[title]" size="30" type="text" value="Hello World" />', text_field("post", "title")
  257 + '<input id="post_title" name="post[title]" type="text" value="Hello World" />', text_field("post", "title")
258 258 )
259 259 assert_dom_equal(
260   - '<input id="post_title" name="post[title]" size="30" type="password" />', password_field("post", "title")
  260 + '<input id="post_title" name="post[title]" type="password" />', password_field("post", "title")
261 261 )
262 262 assert_dom_equal(
263   - '<input id="post_title" name="post[title]" size="30" type="password" value="Hello World" />', password_field("post", "title", :value => @post.title)
  263 + '<input id="post_title" name="post[title]" type="password" value="Hello World" />', password_field("post", "title", :value => @post.title)
264 264 )
265 265 assert_dom_equal(
266   - '<input id="person_name" name="person[name]" size="30" type="password" />', password_field("person", "name")
  266 + '<input id="person_name" name="person[name]" type="password" />', password_field("person", "name")
267 267 )
268 268 end
269 269
270 270 def test_text_field_with_escapes
271 271 @post.title = "<b>Hello World</b>"
272 272 assert_dom_equal(
273   - '<input id="post_title" name="post[title]" size="30" type="text" value="&lt;b&gt;Hello World&lt;/b&gt;" />', text_field("post", "title")
  273 + '<input id="post_title" name="post[title]" type="text" value="&lt;b&gt;Hello World&lt;/b&gt;" />', text_field("post", "title")
274 274 )
275 275 end
276 276
277 277 def test_text_field_with_html_entities
278 278 @post.title = "The HTML Entity for & is &amp;"
279 279 assert_dom_equal(
280   - '<input id="post_title" name="post[title]" size="30" type="text" value="The HTML Entity for &amp; is &amp;amp;" />',
  280 + '<input id="post_title" name="post[title]" type="text" value="The HTML Entity for &amp; is &amp;amp;" />',
281 281 text_field("post", "title")
282 282 )
283 283 end
@@ -301,18 +301,18 @@ def test_text_field_removing_size
301 301 end
302 302
303 303 def test_text_field_with_nil_value
304   - expected = '<input id="post_title" name="post[title]" size="30" type="text" />'
  304 + expected = '<input id="post_title" name="post[title]" type="text" />'
305 305 assert_dom_equal expected, text_field("post", "title", :value => nil)
306 306 end
307 307
308 308 def test_text_field_with_nil_name
309   - expected = '<input id="post_title" size="30" type="text" value="Hello World" />'
  309 + expected = '<input id="post_title" type="text" value="Hello World" />'
310 310 assert_dom_equal expected, text_field("post", "title", :name => nil)
311 311 end
312 312
313 313 def test_text_field_doesnt_change_param_values
314 314 object_name = 'post[]'
315   - expected = '<input id="post_123_title" name="post[123][title]" size="30" type="text" value="Hello World" />'
  315 + expected = '<input id="post_123_title" name="post[123][title]" type="text" value="Hello World" />'
316 316 assert_equal expected, text_field(object_name, "title")
317 317 assert_equal object_name, "post[]"
318 318 end
@@ -346,7 +346,7 @@ def test_hidden_field_with_options
346 346 end
347 347
348 348 def test_text_field_with_custom_type
349   - assert_dom_equal '<input id="user_email" size="30" name="user[email]" type="email" />',
  349 + assert_dom_equal '<input id="user_email" name="user[email]" type="email" />',
350 350 text_field("user", "email", :type => "email")
351 351 end
352 352
@@ -474,7 +474,7 @@ def test_radio_button_with_booleans
474 474
475 475 def test_text_area
476 476 assert_dom_equal(
477   - %{<textarea cols="40" id="post_body" name="post[body]" rows="20">\nBack to the hill and over it again!</textarea>},
  477 + %{<textarea id="post_body" name="post[body]">\nBack to the hill and over it again!</textarea>},
478 478 text_area("post", "body")
479 479 )
480 480 end
@@ -482,14 +482,14 @@ def test_text_area
482 482 def test_text_area_with_escapes
483 483 @post.body = "Back to <i>the</i> hill and over it again!"
484 484 assert_dom_equal(
485   - %{<textarea cols="40" id="post_body" name="post[body]" rows="20">\nBack to &lt;i&gt;the&lt;/i&gt; hill and over it again!</textarea>},
  485 + %{<textarea id="post_body" name="post[body]">\nBack to &lt;i&gt;the&lt;/i&gt; hill and over it again!</textarea>},
486 486 text_area("post", "body")
487 487 )
488 488 end
489 489
490 490 def test_text_area_with_alternate_value
491 491 assert_dom_equal(
492   - %{<textarea cols="40" id="post_body" name="post[body]" rows="20">\nTesting alternate values.</textarea>},
  492 + %{<textarea id="post_body" name="post[body]">\nTesting alternate values.</textarea>},
493 493 text_area("post", "body", :value => 'Testing alternate values.')
494 494 )
495 495 end
@@ -497,7 +497,7 @@ def test_text_area_with_alternate_value
497 497 def test_text_area_with_html_entities
498 498 @post.body = "The HTML Entity for & is &amp;"
499 499 assert_dom_equal(
500   - %{<textarea cols="40" id="post_body" name="post[body]" rows="20">\nThe HTML Entity for &amp; is &amp;amp;</textarea>},
  500 + %{<textarea id="post_body" name="post[body]">\nThe HTML Entity for &amp; is &amp;amp;</textarea>},
501 501 text_area("post", "body")
502 502 )
503 503 end
@@ -510,12 +510,12 @@ def test_text_area_with_size_option
510 510 end
511 511
512 512 def test_search_field
513   - expected = %{<input id="contact_notes_query" size="30" name="contact[notes_query]" type="search" />}
  513 + expected = %{<input id="contact_notes_query" name="contact[notes_query]" type="search" />}
514 514 assert_dom_equal(expected, search_field("contact", "notes_query"))
515 515 end
516 516
517 517 def test_telephone_field
518   - expected = %{<input id="user_cell" size="30" name="user[cell]" type="tel" />}
  518 + expected = %{<input id="user_cell" name="user[cell]" type="tel" />}
519 519 assert_dom_equal(expected, telephone_field("user", "cell"))
520 520 end
521 521
@@ -546,12 +546,12 @@ def test_date_field_with_nil_value
546 546 end
547 547
548 548 def test_url_field
549   - expected = %{<input id="user_homepage" size="30" name="user[homepage]" type="url" />}
  549 + expected = %{<input id="user_homepage" name="user[homepage]" type="url" />}
550 550 assert_dom_equal(expected, url_field("user", "homepage"))
551 551 end
552 552
553 553 def test_email_field
554   - expected = %{<input id="user_address" size="30" name="user[address]" type="email" />}
  554 + expected = %{<input id="user_address" name="user[address]" type="email" />}
555 555 assert_dom_equal(expected, email_field("user", "address"))
556 556 end
557 557
@@ -571,10 +571,10 @@ def test_range_input
571 571
572 572 def test_explicit_name
573 573 assert_dom_equal(
574   - '<input id="post_title" name="dont guess" size="30" type="text" value="Hello World" />', text_field("post", "title", "name" => "dont guess")
  574 + '<input id="post_title" name="dont guess" type="text" value="Hello World" />', text_field("post", "title", "name" => "dont guess")
575 575 )
576 576 assert_dom_equal(
577   - %{<textarea cols="40" id="post_body" name="really!" rows="20">\nBack to the hill and over it again!</textarea>},
  577 + %{<textarea id="post_body" name="really!">\nBack to the hill and over it again!</textarea>},
578 578 text_area("post", "body", "name" => "really!")
579 579 )
580 580 assert_dom_equal(
@@ -591,10 +591,10 @@ def test_explicit_name
591 591
592 592 def test_explicit_id
593 593 assert_dom_equal(
594   - '<input id="dont guess" name="post[title]" size="30" type="text" value="Hello World" />', text_field("post", "title", "id" => "dont guess")
  594 + '<input id="dont guess" name="post[title]" type="text" value="Hello World" />', text_field("post", "title", "id" => "dont guess")
595 595 )
596 596 assert_dom_equal(
597   - %{<textarea cols="40" id="really!" name="post[body]" rows="20">\nBack to the hill and over it again!</textarea>},
  597 + %{<textarea id="really!" name="post[body]">\nBack to the hill and over it again!</textarea>},
598 598 text_area("post", "body", "id" => "really!")
599 599 )
600 600 assert_dom_equal(
@@ -611,10 +611,10 @@ def test_explicit_id
611 611
612 612 def test_nil_id
613 613 assert_dom_equal(
614   - '<input name="post[title]" size="30" type="text" value="Hello World" />', text_field("post", "title", "id" => nil)
  614 + '<input name="post[title]" type="text" value="Hello World" />', text_field("post", "title", "id" => nil)
615 615 )
616 616 assert_dom_equal(
617   - %{<textarea cols="40" name="post[body]" rows="20">\nBack to the hill and over it again!</textarea>},
  617 + %{<textarea name="post[body]">\nBack to the hill and over it again!</textarea>},
618 618 text_area("post", "body", "id" => nil)
619 619 )
620 620 assert_dom_equal(
@@ -641,11 +641,11 @@ def test_nil_id
641 641
642 642 def test_index
643 643 assert_dom_equal(
644   - '<input name="post[5][title]" size="30" id="post_5_title" type="text" value="Hello World" />',
  644 + '<input name="post[5][title]" id="post_5_title" type="text" value="Hello World" />',
645 645 text_field("post", "title", "index" => 5)
646 646 )
647 647 assert_dom_equal(
648   - %{<textarea cols="40" name="post[5][body]" id="post_5_body" rows="20">\nBack to the hill and over it again!</textarea>},
  648 + %{<textarea name="post[5][body]" id="post_5_body">\nBack to the hill and over it again!</textarea>},
649 649 text_area("post", "body", "index" => 5)
650 650 )
651 651 assert_dom_equal(
@@ -668,11 +668,11 @@ def test_index
668 668
669 669 def test_index_with_nil_id
670 670 assert_dom_equal(
671   - '<input name="post[5][title]" size="30" type="text" value="Hello World" />',
  671 + '<input name="post[5][title]" type="text" value="Hello World" />',
672 672 text_field("post", "title", "index" => 5, 'id' => nil)
673 673 )
674 674 assert_dom_equal(
675   - %{<textarea cols="40" name="post[5][body]" rows="20">\nBack to the hill and over it again!</textarea>},
  675 + %{<textarea name="post[5][body]">\nBack to the hill and over it again!</textarea>},
676 676 text_area("post", "body", "index" => 5, 'id' => nil)
677 677 )
678 678 assert_dom_equal(
@@ -700,10 +700,10 @@ def test_auto_index
700 700 label("post[]", "title")
701 701 )
702 702 assert_dom_equal(
703   - "<input id=\"post_#{pid}_title\" name=\"post[#{pid}][title]\" size=\"30\" type=\"text\" value=\"Hello World\" />", text_field("post[]","title")
  703 + "<input id=\"post_#{pid}_title\" name=\"post[#{pid}][title]\" type=\"text\" value=\"Hello World\" />", text_field("post[]","title")
704 704 )
705 705 assert_dom_equal(
706   - "<textarea cols=\"40\" id=\"post_#{pid}_body\" name=\"post[#{pid}][body]\" rows=\"20\">\nBack to the hill and over it again!</textarea>",
  706 + "<textarea id=\"post_#{pid}_body\" name=\"post[#{pid}][body]\">\nBack to the hill and over it again!</textarea>",
707 707 text_area("post[]", "body")
708 708 )
709 709 assert_dom_equal(
@@ -722,11 +722,11 @@ def test_auto_index
722 722 def test_auto_index_with_nil_id
723 723 pid = 123
724 724 assert_dom_equal(
725   - "<input name=\"post[#{pid}][title]\" size=\"30\" type=\"text\" value=\"Hello World\" />",
  725 + "<input name=\"post[#{pid}][title]\" type=\"text\" value=\"Hello World\" />",
726 726 text_field("post[]","title", :id => nil)
727 727 )
728 728 assert_dom_equal(
729   - "<textarea cols=\"40\" name=\"post[#{pid}][body]\" rows=\"20\">\nBack to the hill and over it again!</textarea>",
  729 + "<textarea name=\"post[#{pid}][body]\">\nBack to the hill and over it again!</textarea>",
730 730 text_area("post[]", "body", :id => nil)
731 731 )
732 732 assert_dom_equal(
@@ -760,8 +760,8 @@ def test_form_for
760 760
761 761 expected = whole_form("/posts/123", "create-post" , "edit_post", :method => 'patch') do
762 762 "<label for='post_title'>The Title</label>" +
763   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
764   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  763 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  764 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
765 765 "<input name='post[secret]' type='hidden' value='0' />" +
766 766 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
767 767 "<input name='commit' type='submit' value='Create post' />" +
@@ -859,7 +859,7 @@ def test_form_for_with_model_using_relative_model_naming
859 859 end
860 860
861 861 expected = whole_form("/posts/44", "edit_post_44" , "edit_post", :method => 'patch') do
862   - "<input name='post[title]' size='30' type='text' id='post_title' value='And his name will be forty and four.' />" +
  862 + "<input name='post[title]' type='text' id='post_title' value='And his name will be forty and four.' />" +
863 863 "<input name='commit' type='submit' value='Edit post' />"
864 864 end
865 865
@@ -877,8 +877,8 @@ def test_form_for_with_symbol_object_name
877 877
878 878 expected = whole_form("/posts/123", "create-post", "edit_other_name", :method => 'patch') do
879 879 "<label for='other_name_title' class='post_title'>Title</label>" +
880   - "<input name='other_name[title]' size='30' id='other_name_title' value='Hello World' type='text' />" +
881   - "<textarea name='other_name[body]' id='other_name_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  880 + "<input name='other_name[title]' id='other_name_title' value='Hello World' type='text' />" +
  881 + "<textarea name='other_name[body]' id='other_name_body'>\nBack to the hill and over it again!</textarea>" +
882 882 "<input name='other_name[secret]' value='0' type='hidden' />" +
883 883 "<input name='other_name[secret]' checked='checked' id='other_name_secret' value='1' type='checkbox' />" +
884 884 "<input name='commit' value='Create post' type='submit' />"
@@ -895,8 +895,8 @@ def test_form_for_with_method_as_part_of_html_options
895 895 end
896 896
897 897 expected = whole_form("/", "create-post", "edit_post", "delete") do
898   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
899   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  898 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  899 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
900 900 "<input name='post[secret]' type='hidden' value='0' />" +
901 901 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
902 902 end
@@ -912,8 +912,8 @@ def test_form_for_with_method
912 912 end
913 913
914 914 expected = whole_form("/", "create-post", "edit_post", "delete") do
915   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
916   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  915 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  916 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
917 917 "<input name='post[secret]' type='hidden' value='0' />" +
918 918 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
919 919 end
@@ -929,7 +929,7 @@ def test_form_for_with_search_field
929 929 end
930 930
931 931 expected = whole_form("/search", "search-post", "new_post", "get") do
932   - "<input name='post[title]' size='30' type='search' id='post_title' />"
  932 + "<input name='post[title]' type='search' id='post_title' />"
933 933 end
934 934
935 935 assert_dom_equal expected, output_buffer
@@ -943,8 +943,8 @@ def test_form_for_with_remote
943 943 end
944 944
945 945 expected = whole_form("/", "create-post", "edit_post", :method => 'patch', :remote => true) do
946   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
947   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  946 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  947 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
948 948 "<input name='post[secret]' type='hidden' value='0' />" +
949 949 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
950 950 end
@@ -960,8 +960,8 @@ def test_form_for_with_remote_in_html
960 960 end
961 961
962 962 expected = whole_form("/", "create-post", "edit_post", :method => 'patch', :remote => true) do
963   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
964   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  963 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  964 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
965 965 "<input name='post[secret]' type='hidden' value='0' />" +
966 966 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
967 967 end
@@ -979,8 +979,8 @@ def test_form_for_with_remote_without_html
979 979 end
980 980
981 981 expected = whole_form("/posts", 'new_post', 'new_post', :remote => true) do
982   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
983   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  982 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  983 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
984 984 "<input name='post[secret]' type='hidden' value='0' />" +
985 985 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
986 986 end
@@ -996,8 +996,8 @@ def test_form_for_without_object
996 996 end
997 997
998 998 expected = whole_form("/", "create-post") do
999   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
1000   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  999 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  1000 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
1001 1001 "<input name='post[secret]' type='hidden' value='0' />" +
1002 1002 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
1003 1003 end
@@ -1015,8 +1015,8 @@ def test_form_for_with_index
1015 1015
1016 1016 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1017 1017 "<label for='post_123_title'>Title</label>" +
1018   - "<input name='post[123][title]' size='30' type='text' id='post_123_title' value='Hello World' />" +
1019   - "<textarea name='post[123][body]' id='post_123_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1018 + "<input name='post[123][title]' type='text' id='post_123_title' value='Hello World' />" +
  1019 + "<textarea name='post[123][body]' id='post_123_body'>\nBack to the hill and over it again!</textarea>" +
1020 1020 "<input name='post[123][secret]' type='hidden' value='0' />" +
1021 1021 "<input name='post[123][secret]' checked='checked' type='checkbox' id='post_123_secret' value='1' />"
1022 1022 end
@@ -1032,8 +1032,8 @@ def test_form_for_with_nil_index_option_override
1032 1032 end
1033 1033
1034 1034 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1035   - "<input name='post[][title]' size='30' type='text' id='post__title' value='Hello World' />" +
1036   - "<textarea name='post[][body]' id='post__body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1035 + "<input name='post[][title]' type='text' id='post__title' value='Hello World' />" +
  1036 + "<textarea name='post[][body]' id='post__body'>\nBack to the hill and over it again!</textarea>" +
1037 1037 "<input name='post[][secret]' type='hidden' value='0' />" +
1038 1038 "<input name='post[][secret]' checked='checked' type='checkbox' id='post__secret' value='1' />"
1039 1039 end
@@ -1049,8 +1049,8 @@ def test_form_for_with_namespace
1049 1049 end
1050 1050
1051 1051 expected = whole_form('/posts/123', 'namespace_edit_post_123', 'edit_post', 'patch') do
1052   - "<input name='post[title]' size='30' type='text' id='namespace_post_title' value='Hello World' />" +
1053   - "<textarea name='post[body]' id='namespace_post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1052 + "<input name='post[title]' type='text' id='namespace_post_title' value='Hello World' />" +
  1053 + "<textarea name='post[body]' id='namespace_post_body'>\nBack to the hill and over it again!</textarea>" +
1054 1054 "<input name='post[secret]' type='hidden' value='0' />" +
1055 1055 "<input name='post[secret]' checked='checked' type='checkbox' id='namespace_post_secret' value='1' />"
1056 1056 end
@@ -1066,7 +1066,7 @@ def test_form_for_with_namespace_with_label
1066 1066
1067 1067 expected = whole_form('/posts/123', 'namespace_edit_post_123', 'edit_post', 'patch') do
1068 1068 "<label for='namespace_post_title'>Title</label>" +
1069   - "<input name='post[title]' size='30' type='text' id='namespace_post_title' value='Hello World' />"
  1069 + "<input name='post[title]' type='text' id='namespace_post_title' value='Hello World' />"
1070 1070 end
1071 1071
1072 1072 assert_dom_equal expected, output_buffer
@@ -1080,7 +1080,7 @@ def test_two_form_for_with_namespace
1080 1080
1081 1081 expected_1 = whole_form('/posts/123', 'namespace_1_edit_post_123', 'edit_post', 'patch') do
1082 1082 "<label for='namespace_1_post_title'>Title</label>" +
1083   - "<input name='post[title]' size='30' type='text' id='namespace_1_post_title' value='Hello World' />"
  1083 + "<input name='post[title]' type='text' id='namespace_1_post_title' value='Hello World' />"
1084 1084 end
1085 1085
1086 1086 assert_dom_equal expected_1, output_buffer
@@ -1092,7 +1092,7 @@ def test_two_form_for_with_namespace
1092 1092
1093 1093 expected_2 = whole_form('/posts/123', 'namespace_2_edit_post_123', 'edit_post', 'patch') do
1094 1094 "<label for='namespace_2_post_title'>Title</label>" +
1095   - "<input name='post[title]' size='30' type='text' id='namespace_2_post_title' value='Hello World' />"
  1095 + "<input name='post[title]' type='text' id='namespace_2_post_title' value='Hello World' />"
1096 1096 end
1097 1097
1098 1098 assert_dom_equal expected_2, output_buffer
@@ -1109,9 +1109,9 @@ def test_fields_for_with_namespace
1109 1109 end
1110 1110
1111 1111 expected = whole_form('/posts/123', 'namespace_edit_post_123', 'edit_post', 'patch') do
1112   - "<input name='post[title]' size='30' type='text' id='namespace_post_title' value='Hello World' />" +
1113   - "<textarea name='post[body]' id='namespace_post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
1114   - "<input name='post[comment][body]' size='30' type='text' id='namespace_post_comment_body' value='Hello World' />"
  1112 + "<input name='post[title]' type='text' id='namespace_post_title' value='Hello World' />" +
  1113 + "<textarea name='post[body]' id='namespace_post_body'>\nBack to the hill and over it again!</textarea>" +
  1114 + "<input name='post[comment][body]' type='text' id='namespace_post_comment_body' value='Hello World' />"
1115 1115 end
1116 1116
1117 1117 assert_dom_equal expected, output_buffer
@@ -1192,7 +1192,7 @@ def test_nested_fields_for
1192 1192 end
1193 1193
1194 1194 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1195   - "<input name='post[comment][body]' size='30' type='text' id='post_comment_body' value='Hello World' />"
  1195 + "<input name='post[comment][body]' type='text' id='post_comment_body' value='Hello World' />"
1196 1196 end
1197 1197
1198 1198 assert_dom_equal expected, output_buffer
@@ -1207,8 +1207,8 @@ def test_nested_fields_for_with_nested_collections
1207 1207 end
1208 1208
1209 1209 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1210   - "<input name='post[123][title]' size='30' type='text' id='post_123_title' value='Hello World' />" +
1211   - "<input name='post[123][comment][][name]' size='30' type='text' id='post_123_comment__name' value='new comment' />"
  1210 + "<input name='post[123][title]' type='text' id='post_123_title' value='Hello World' />" +
  1211 + "<input name='post[123][comment][][name]' type='text' id='post_123_comment__name' value='new comment' />"
1212 1212 end
1213 1213
1214 1214 assert_dom_equal expected, output_buffer
@@ -1223,8 +1223,8 @@ def test_nested_fields_for_with_index_and_parent_fields
1223 1223 end
1224 1224
1225 1225 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'patch') do
1226   - "<input name='post[1][title]' size='30' type='text' id='post_1_title' value='Hello World' />" +
1227   - "<input name='post[1][comment][1][name]' size='30' type='text' id='post_1_comment_1_name' value='new comment' />"
  1226 + "<input name='post[1][title]' type='text' id='post_1_title' value='Hello World' />" +
  1227 + "<input name='post[1][comment][1][name]' type='text' id='post_1_comment_1_name' value='new comment' />"
1228 1228 end
1229 1229
1230 1230 assert_dom_equal expected, output_buffer
@@ -1238,7 +1238,7 @@ def test_form_for_with_index_and_nested_fields_for
1238 1238 end
1239 1239
1240 1240 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'patch') do
1241   - "<input name='post[1][comment][title]' size='30' type='text' id='post_1_comment_title' value='Hello World' />"
  1241 + "<input name='post[1][comment][title]' type='text' id='post_1_comment_title' value='Hello World' />"
1242 1242 end
1243 1243
1244 1244 assert_dom_equal expected, output_buffer
@@ -1252,7 +1252,7 @@ def test_nested_fields_for_with_index_on_both
1252 1252 end
1253 1253
1254 1254 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', 'patch') do
1255   - "<input name='post[1][comment][5][title]' size='30' type='text' id='post_1_comment_5_title' value='Hello World' />"
  1255 + "<input name='post[1][comment][5][title]' type='text' id='post_1_comment_5_title' value='Hello World' />"
1256 1256 end
1257 1257
1258 1258 assert_dom_equal expected, output_buffer
@@ -1266,7 +1266,7 @@ def test_nested_fields_for_with_auto_index
1266 1266 end
1267 1267
1268 1268 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1269   - "<input name='post[123][comment][title]' size='30' type='text' id='post_123_comment_title' value='Hello World' />"
  1269 + "<input name='post[123][comment][title]' type='text' id='post_123_comment_title' value='Hello World' />"
1270 1270 end
1271 1271
1272 1272 assert_dom_equal expected, output_buffer
@@ -1294,7 +1294,7 @@ def test_nested_fields_for_with_auto_index_on_both
1294 1294 end
1295 1295
1296 1296 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1297   - "<input name='post[123][comment][123][title]' size='30' type='text' id='post_123_comment_123_title' value='Hello World' />"
  1297 + "<input name='post[123][comment][123][title]' type='text' id='post_123_comment_123_title' value='Hello World' />"
1298 1298 end
1299 1299
1300 1300 assert_dom_equal expected, output_buffer
@@ -1314,9 +1314,9 @@ def test_nested_fields_for_with_index_and_auto_index
1314 1314 end
1315 1315
1316 1316 expected = whole_form('/posts/123', 'edit_post[]', 'edit_post[]', 'patch') do
1317   - "<input name='post[123][comment][5][title]' size='30' type='text' id='post_123_comment_5_title' value='Hello World' />"
  1317 + "<input name='post[123][comment][5][title]' type='text' id='post_123_comment_5_title' value='Hello World' />"
1318 1318 end + whole_form('/posts/123', 'edit_post', 'edit_post', 'patch') do
1319   - "<input name='post[1][comment][123][title]' size='30' type='text' id='post_1_comment_123_title' value='Hello World' />"
  1319 + "<input name='post[1][comment][123][title]' type='text' id='post_1_comment_123_title' value='Hello World' />"
1320 1320 end
1321 1321
1322 1322 assert_dom_equal expected, output_buffer
@@ -1333,8 +1333,8 @@ def test_nested_fields_for_with_a_new_record_on_a_nested_attributes_one_to_one_a
1333 1333 end
1334 1334
1335 1335 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1336   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1337   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="new author" />'
  1336 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1337 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="new author" />'
1338 1338 end
1339 1339
1340 1340 assert_dom_equal expected, output_buffer
@@ -1360,8 +1360,8 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
1360 1360 end
1361 1361
1362 1362 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1363   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1364   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
  1363 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1364 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
1365 1365 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />'
1366 1366 end
1367 1367
@@ -1379,8 +1379,8 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
1379 1379 end
1380 1380
1381 1381 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1382   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1383   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
  1382 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1383 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
1384 1384 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />'
1385 1385 end
1386 1386
@@ -1398,8 +1398,8 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
1398 1398 end
1399 1399
1400 1400 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1401   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1402   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />'
  1401 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1402 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />'
1403 1403 end
1404 1404
1405 1405 assert_dom_equal expected, output_buffer
@@ -1416,8 +1416,8 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
1416 1416 end
1417 1417
1418 1418 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1419   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1420   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />'
  1419 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1420 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />'
1421 1421 end
1422 1422
1423 1423 assert_dom_equal expected, output_buffer
@@ -1434,8 +1434,8 @@ def test_nested_fields_for_with_an_existing_record_on_a_nested_attributes_one_to
1434 1434 end
1435 1435
1436 1436 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1437   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1438   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
  1437 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1438 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
1439 1439 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />'
1440 1440 end
1441 1441
@@ -1454,9 +1454,9 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_one_to_o
1454 1454 end
1455 1455
1456 1456 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1457   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
  1457 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
1458 1458 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />' +
1459   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />'
  1459 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />'
1460 1460 end
1461 1461
1462 1462 assert_dom_equal expected, output_buffer
@@ -1475,10 +1475,10 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1475 1475 end
1476 1476
1477 1477 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1478   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1479   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1478 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1479 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1480 1480 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1481   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />' +
  1481 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />' +
1482 1482 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />'
1483 1483 end
1484 1484
@@ -1502,11 +1502,11 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1502 1502 end
1503 1503
1504 1504 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1505   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1506   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
  1505 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1506 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
1507 1507 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />' +
1508   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
1509   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />'
  1508 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
  1509 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />'
1510 1510 end
1511 1511
1512 1512 assert_dom_equal expected, output_buffer
@@ -1529,10 +1529,10 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1529 1529 end
1530 1530
1531 1531 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1532   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1533   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
1534   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
1535   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />'
  1532 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1533 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
  1534 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
  1535 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />'
1536 1536 end
1537 1537
1538 1538 assert_dom_equal expected, output_buffer
@@ -1555,11 +1555,11 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1555 1555 end
1556 1556
1557 1557 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1558   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1559   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="author #321" />' +
  1558 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1559 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="author #321" />' +
1560 1560 '<input id="post_author_attributes_id" name="post[author_attributes][id]" type="hidden" value="321" />' +
1561   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
1562   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />'
  1561 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
  1562 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />'
1563 1563 end
1564 1564
1565 1565 assert_dom_equal expected, output_buffer
@@ -1578,10 +1578,10 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1578 1578 end
1579 1579
1580 1580 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1581   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1582   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1581 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1582 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1583 1583 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1584   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />' +
  1584 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />' +
1585 1585 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />'
1586 1586 end
1587 1587
@@ -1602,11 +1602,11 @@ def test_nested_fields_for_with_existing_records_on_a_nested_attributes_collecti
1602 1602 end
1603 1603
1604 1604 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1605   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
  1605 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
1606 1606 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1607   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1607 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1608 1608 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />' +
1609   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />'
  1609 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />'
1610 1610 end
1611 1611
1612 1612 assert_dom_equal expected, output_buffer
@@ -1625,9 +1625,9 @@ def test_nested_fields_for_with_new_records_on_a_nested_attributes_collection_as
1625 1625 end
1626 1626
1627 1627 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1628   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1629   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="new comment" />' +
1630   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="new comment" />'
  1628 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1629 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="new comment" />' +
  1630 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="new comment" />'
1631 1631 end
1632 1632
1633 1633 assert_dom_equal expected, output_buffer
@@ -1646,10 +1646,10 @@ def test_nested_fields_for_with_existing_and_new_records_on_a_nested_attributes_
1646 1646 end
1647 1647
1648 1648 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1649   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1650   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #321" />' +
  1649 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1650 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #321" />' +
1651 1651 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="321" />' +
1652   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="new comment" />'
  1652 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="new comment" />'
1653 1653 end
1654 1654
1655 1655 assert_dom_equal expected, output_buffer
@@ -1664,7 +1664,7 @@ def test_nested_fields_for_with_an_empty_supplied_attributes_collection
1664 1664 end
1665 1665
1666 1666 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1667   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />'
  1667 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />'
1668 1668 end
1669 1669
1670 1670 assert_dom_equal expected, output_buffer
@@ -1681,10 +1681,10 @@ def test_nested_fields_for_with_existing_records_on_a_supplied_nested_attributes
1681 1681 end
1682 1682
1683 1683 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1684   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1685   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1684 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1685 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1686 1686 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1687   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />' +
  1687 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />' +
1688 1688 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />'
1689 1689 end
1690 1690
@@ -1702,10 +1702,10 @@ def test_nested_fields_for_arel_like
1702 1702 end
1703 1703
1704 1704 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1705   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1706   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1705 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1706 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1707 1707 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1708   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />' +
  1708 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />' +
1709 1709 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />'
1710 1710 end
1711 1711
@@ -1724,10 +1724,10 @@ def test_nested_fields_for_with_existing_records_on_a_supplied_nested_attributes
1724 1724 end
1725 1725
1726 1726 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1727   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1728   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #1" />' +
  1727 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1728 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #1" />' +
1729 1729 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="1" />' +
1730   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="comment #2" />' +
  1730 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="comment #2" />' +
1731 1731 '<input id="post_comments_attributes_1_id" name="post[comments_attributes][1][id]" type="hidden" value="2" />'
1732 1732 end
1733 1733
@@ -1747,10 +1747,10 @@ def test_nested_fields_for_on_a_nested_attributes_collection_association_yields_
1747 1747 end
1748 1748
1749 1749 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1750   - '<input name="post[title]" size="30" type="text" id="post_title" value="Hello World" />' +
1751   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #321" />' +
  1750 + '<input name="post[title]" type="text" id="post_title" value="Hello World" />' +
  1751 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #321" />' +
1752 1752 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="321" />' +
1753   - '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" size="30" type="text" value="new comment" />'
  1753 + '<input id="post_comments_attributes_1_name" name="post[comments_attributes][1][name]" type="text" value="new comment" />'
1754 1754 end
1755 1755
1756 1756 assert_dom_equal expected, output_buffer
@@ -1767,7 +1767,7 @@ def test_nested_fields_for_with_child_index_option_override_on_a_nested_attribut
1767 1767 end
1768 1768
1769 1769 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1770   - '<input id="post_comments_attributes_abc_name" name="post[comments_attributes][abc][name]" size="30" type="text" value="comment #321" />' +
  1770 + '<input id="post_comments_attributes_abc_name" name="post[comments_attributes][abc][name]" type="text" value="comment #321" />' +
1771 1771 '<input id="post_comments_attributes_abc_id" name="post[comments_attributes][abc][id]" type="hidden" value="321" />'
1772 1772 end
1773 1773
@@ -1803,16 +1803,16 @@ def test_nested_fields_uses_unique_indices_for_different_collection_associations
1803 1803 end
1804 1804
1805 1805 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1806   - '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" size="30" type="text" value="comment #321" />' +
1807   - '<input id="post_comments_attributes_0_relevances_attributes_0_value" name="post[comments_attributes][0][relevances_attributes][0][value]" size="30" type="text" value="commentrelevance #314" />' +
  1806 + '<input id="post_comments_attributes_0_name" name="post[comments_attributes][0][name]" type="text" value="comment #321" />' +
  1807 + '<input id="post_comments_attributes_0_relevances_attributes_0_value" name="post[comments_attributes][0][relevances_attributes][0][value]" type="text" value="commentrelevance #314" />' +
1808 1808 '<input id="post_comments_attributes_0_relevances_attributes_0_id" name="post[comments_attributes][0][relevances_attributes][0][id]" type="hidden" value="314" />' +
1809 1809 '<input id="post_comments_attributes_0_id" name="post[comments_attributes][0][id]" type="hidden" value="321" />' +
1810   - '<input id="post_tags_attributes_0_value" name="post[tags_attributes][0][value]" size="30" type="text" value="tag #123" />' +
1811   - '<input id="post_tags_attributes_0_relevances_attributes_0_value" name="post[tags_attributes][0][relevances_attributes][0][value]" size="30" type="text" value="tagrelevance #3141" />' +
  1810 + '<input id="post_tags_attributes_0_value" name="post[tags_attributes][0][value]" type="text" value="tag #123" />' +
  1811 + '<input id="post_tags_attributes_0_relevances_attributes_0_value" name="post[tags_attributes][0][relevances_attributes][0][value]" type="text" value="tagrelevance #3141" />' +
1812 1812 '<input id="post_tags_attributes_0_relevances_attributes_0_id" name="post[tags_attributes][0][relevances_attributes][0][id]" type="hidden" value="3141" />' +
1813 1813 '<input id="post_tags_attributes_0_id" name="post[tags_attributes][0][id]" type="hidden" value="123" />' +
1814   - '<input id="post_tags_attributes_1_value" name="post[tags_attributes][1][value]" size="30" type="text" value="tag #456" />' +
1815   - '<input id="post_tags_attributes_1_relevances_attributes_0_value" name="post[tags_attributes][1][relevances_attributes][0][value]" size="30" type="text" value="tagrelevance #31415" />' +
  1814 + '<input id="post_tags_attributes_1_value" name="post[tags_attributes][1][value]" type="text" value="tag #456" />' +
  1815 + '<input id="post_tags_attributes_1_relevances_attributes_0_value" name="post[tags_attributes][1][relevances_attributes][0][value]" type="text" value="tagrelevance #31415" />' +
1816 1816 '<input id="post_tags_attributes_1_relevances_attributes_0_id" name="post[tags_attributes][1][relevances_attributes][0][id]" type="hidden" value="31415" />' +
1817 1817 '<input id="post_tags_attributes_1_id" name="post[tags_attributes][1][id]" type="hidden" value="456" />'
1818 1818 end
@@ -1830,7 +1830,7 @@ def test_nested_fields_for_with_hash_like_model
1830 1830 end
1831 1831
1832 1832 expected = whole_form('/posts/123', 'edit_post_123', 'edit_post', :method => 'patch') do
1833   - '<input id="post_author_attributes_name" name="post[author_attributes][name]" size="30" type="text" value="hash backed author" />'
  1833 + '<input id="post_author_attributes_name" name="post[author_attributes][name]" type="text" value="hash backed author" />'
1834 1834 end
1835 1835
1836 1836 assert_dom_equal expected, output_buffer
@@ -1844,8 +1844,8 @@ def test_fields_for
1844 1844 end
1845 1845
1846 1846 expected =
1847   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
1848   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1847 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  1848 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
1849 1849 "<input name='post[secret]' type='hidden' value='0' />" +
1850 1850 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
1851 1851
@@ -1860,8 +1860,8 @@ def test_fields_for_with_index
1860 1860 end
1861 1861
1862 1862 expected =
1863   - "<input name='post[123][title]' size='30' type='text' id='post_123_title' value='Hello World' />" +
1864   - "<textarea name='post[123][body]' id='post_123_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1863 + "<input name='post[123][title]' type='text' id='post_123_title' value='Hello World' />" +
  1864 + "<textarea name='post[123][body]' id='post_123_body'>\nBack to the hill and over it again!</textarea>" +
1865 1865 "<input name='post[123][secret]' type='hidden' value='0' />" +
1866 1866 "<input name='post[123][secret]' checked='checked' type='checkbox' id='post_123_secret' value='1' />"
1867 1867
@@ -1876,8 +1876,8 @@ def test_fields_for_with_nil_index_option_override
1876 1876 end
1877 1877
1878 1878 expected =
1879   - "<input name='post[][title]' size='30' type='text' id='post__title' value='Hello World' />" +
1880   - "<textarea name='post[][body]' id='post__body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1879 + "<input name='post[][title]' type='text' id='post__title' value='Hello World' />" +
  1880 + "<textarea name='post[][body]' id='post__body'>\nBack to the hill and over it again!</textarea>" +
1881 1881 "<input name='post[][secret]' type='hidden' value='0' />" +
1882 1882 "<input name='post[][secret]' checked='checked' type='checkbox' id='post__secret' value='1' />"
1883 1883
@@ -1892,8 +1892,8 @@ def test_fields_for_with_index_option_override
1892 1892 end
1893 1893
1894 1894 expected =
1895   - "<input name='post[abc][title]' size='30' type='text' id='post_abc_title' value='Hello World' />" +
1896   - "<textarea name='post[abc][body]' id='post_abc_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1895 + "<input name='post[abc][title]' type='text' id='post_abc_title' value='Hello World' />" +
  1896 + "<textarea name='post[abc][body]' id='post_abc_body'>\nBack to the hill and over it again!</textarea>" +
1897 1897 "<input name='post[abc][secret]' type='hidden' value='0' />" +
1898 1898 "<input name='post[abc][secret]' checked='checked' type='checkbox' id='post_abc_secret' value='1' />"
1899 1899
@@ -1908,8 +1908,8 @@ def test_fields_for_without_object
1908 1908 end
1909 1909
1910 1910 expected =
1911   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
1912   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1911 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  1912 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
1913 1913 "<input name='post[secret]' type='hidden' value='0' />" +
1914 1914 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
1915 1915
@@ -1924,8 +1924,8 @@ def test_fields_for_with_only_object
1924 1924 end
1925 1925
1926 1926 expected =
1927   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
1928   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1927 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  1928 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
1929 1929 "<input name='post[secret]' type='hidden' value='0' />" +
1930 1930 "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />"
1931 1931
@@ -1939,7 +1939,7 @@ def test_fields_for_object_with_bracketed_name
1939 1939 end
1940 1940
1941 1941 assert_dom_equal "<label for=\"author_post_title\">Title</label>" +
1942   - "<input name='author[post][title]' size='30' type='text' id='author_post_title' value='Hello World' />",
  1942 + "<input name='author[post][title]' type='text' id='author_post_title' value='Hello World' />",
1943 1943 output_buffer
1944 1944 end
1945 1945
@@ -1950,7 +1950,7 @@ def test_fields_for_object_with_bracketed_name_and_index
1950 1950 end
1951 1951
1952 1952 assert_dom_equal "<label for=\"author_post_1_title\">Title</label>" +
1953   - "<input name='author[post][1][title]' size='30' type='text' id='author_post_1_title' value='Hello World' />",
  1953 + "<input name='author[post][1][title]' type='text' id='author_post_1_title' value='Hello World' />",
1954 1954 output_buffer
1955 1955 end
1956 1956
@@ -1969,8 +1969,8 @@ def test_form_for_and_fields_for
1969 1969 end
1970 1970
1971 1971 expected = whole_form('/posts/123', 'create-post', 'edit_post', :method => 'patch') do
1972   - "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" +
1973   - "<textarea name='post[body]' id='post_body' rows='20' cols='40'>\nBack to the hill and over it again!</textarea>" +
  1972 + "<input name='post[title]' type='text' id='post_title' value='Hello World' />" +
  1973 + "<textarea name='post[body]' id='post_body'>\nBack to the hill and over it again!</textarea>" +
1974 1974 "<input name='parent_post[secret]' type='hidden' value='0' />" +
1975 1975 "<input name='parent_post[secret]' checked='checked' type='checkbox' id='parent_post_secret' value='1' />"
1976 1976 end
@@ -1989,9 +1989,9 @@ def test_form_for_and_fields_for_with_object