aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/form_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed Mocha from ActionView part 1Ronak Jangir2015-08-241-26/+29
|
* Make disable_with default in submit_tagJustin Schiff2015-08-111-9/+9
| | | | | | | | | | | | | | Prevents double submission by making disable_with the default. Default disable_with option will only be applied if user has not specified her/his own disable_with option, whether that is in the `data-disable-with` string form or the `:data => { :disable_with => "Saving..." }` hash form. disable_with will default to the value attribute. A configuration option was added to opt out of this functionality if the user so desires. `config.action_view.automatically_disable_submit_tag = false`
* Override default form builder for a controllerKevin McPhillips2015-04-131-0/+24
|
* Accept lambda as child_index option in #fields_for methodKarol Galanciak2015-04-051-0/+17
|
* Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR form_forMiklos Fazekas2015-02-061-0/+12
| | | | | Refactoring at #18647 broke using non active record objects in form_for. This patch restores the original behaviour where we only compute i18 key when object.respond_to?(:to_model)
* Add tests to make sure label and placeholder respect to_modelRafael Mendonça França2015-02-051-0/+42
|
* Eliminate a ruby warning in a test in Action ViewYuki Nishijima2015-01-171-1/+5
| | | | | | | This eliminates the warning below: actionview/test/template/form_helper_test.rb:913: warning: method redefined; discarding old id_came_from_user? actionview/test/template/form_helper_test.rb:104: warning: previous definition of id_came_from_user? was here
* Only use the `_before_type_cast` in the form when from user inputSean Griffin2015-01-141-0/+17
| | | | | | While we don't want to change the form input when validations fail, blindly using `_before_type_cast` will cause the input to display the wrong data for any type which does additional work on database values.
* Add tests with an explanation of why we're using `_before_type_cast`Sean Griffin2015-01-141-3/+4
| | | | | | | If you entered incorrect input into a form (particularly with a numericality validation), we should not replace what you typed in with `0`, since clicking submit a second time would essentially be the same as erroneously accepting the junk input as 0.
* Revert "Don't use the `_before_type_cast` version of attributes in the form"Sean Griffin2015-01-141-1/+1
| | | | This reverts commit 787e22bb491bd8c36db1e9734261c4ce02c5c5fd.
* Don't use the `_before_type_cast` version of attributes in the formSean Griffin2015-01-141-1/+1
| | | | | | | | | | | We should never be ignoring valuable information that the types may need to give us. The reason that it originally used `_before_type_cast` is unclear, but appears to date back long enough that the reasons may not be relevant today. There is only one test that asserts that it uses the before type cast version, but it gives no context as to why and uses a mock which does not simulate the real world. Fixes #18523.
* Merge pull request #17973 from maurogeorge/file_field_hidden_fieldRafael Mendonça França2015-01-021-5/+20
|\ | | | | | | Generate a hidden_tag when using a file_field
| * Add a hidden_field on the file_fieldMauro George2015-01-021-5/+20
|/ | | | | This will avoid a error be raised when the only input on the form is the `file_field`.
* Fix options overwritten by superJose Añasco2014-12-091-0/+5
|
* Add `:enforce_utf8` option to form_forclaudiob2014-11-201-3/+33
| | | | | | | | | Since 06388b0 `form_tag` accepts the option `enforce_utf8` which, when set to false, prevents the hidden "UTF8 enforcer" field from appearing in the output. This commit implements the same behavior for `form_for`. Stems from https://github.com/rails/rails/pull/17685#issuecomment-63871395
* Improve test of private properties of objects in form tagsRafael Mendonça França2014-10-311-28/+9
|
* Use public_send for form tagsagius2014-10-311-0/+27
|
* Honor public/private in ActionView::Helpers::Tags::Base#valueTobias Pfeiffer2014-10-311-0/+6
| | | | | * use public_send instead of send to avoid calling private methods in form helpers
* remove un-needed sortschneems2014-10-071-8/+7
| | | | | | HTML doesn't care what order the elements are rendered in, so why should we? Updates tests to use proper `assert_dom_equal` instead of `assert_equal` /cc @jeremy
* Merge pull request #16488 from agrobbin/form-label-builderJeremy Kemper2014-08-251-0/+9
|\ | | | | Provide a builder for form labels to customize wrapping around I18n content
| * provide a builder for form labels to customize wrapping around I18n contentAlex Robbin2014-08-201-0/+9
| |
* | just use the placeholder tag value if it is passed as a StringAlex Robbin2014-08-221-4/+19
| |
* | add I18n support for `:placeholder` HTML option is passed to form fieldsAlex Robbin2014-08-221-0/+168
| |
* | Revert "Add I18n support for `:placeholder` HTML option is passed to form ↵Jeremy Kemper2014-08-211-168/+0
|/ | | | fields"
* add I18n support for `:placeholder` HTML option is passed to form fieldsAlex Robbin2014-08-121-0/+168
|
* adding missing test for text area value before type castEugene Gilburg2014-07-191-0/+7
|
* Add String support for min/max attributes on DatetimeFieldTodd Bealmear2014-06-301-0/+64
|
* Merge pull request #15715 from ↵Yves Senn2014-06-141-2/+4
|\ | | | | | | | | | | zuhao/refactor_actionview_cleanup_I18n_translations Clean up I18n stored translations after test.
| * Clean up I18n stored translations after test.Zuhao Wan2014-06-141-2/+5
|/
* Include label value in i18n attribute lookupJoshua Cody2014-05-061-0/+9
| | | | | | | | | | | | | | | | | | | | | Previously, only the object and method name from the label tag were used when looking up the translation for a label. If a value is given for the label, this ought to be additionally used. The following: # form.html.erb <%= form_for @post do |f| %> <%= f.label :type, value: "long" %> <% end %> # en.yml en: activerecord: attributes: post/long: "Long-form Post" Used to simply return "long", but now it will return "Long-form Post".
* Add test for using ActionView::Helpers::FormHelper.label with block and htmlZachary Scott2014-04-221-0/+7
|
* Merge pull request #14738 from tilsammans/pull/11407Rafael Mendonça França2014-04-171-3/+4
|\ | | | | | | | | | | | | Remove wrapping div with inline styles for hidden form fields. Conflicts: actionview/CHANGELOG.md
| * Remove wrapping div with inline styles for hidden form fields.Joost Baaij2014-04-141-3/+4
| | | | | | | | | | | | We are dropping HTML 4.01 and XHTML strict compliance since input tags directly inside a form are valid HTML5, and the absense of inline styles help in validating for Content Security Policy.
* | Use the index on hidden fieldRafael Mendonça França2014-04-141-1/+1
|/
* refactor, with_locale is not needed because I18n is mocked.Yves Senn2014-02-241-7/+5
| | | | | This is a follow up to #14170. While backporting I recognized that this call is not needed at all.
* Fix ActionView label translation for more than 10 nested elementsVladimir Krylov2014-02-241-0/+14
|
* refactor, extract `with_locale` helper.Yves Senn2014-02-241-87/+79
|
* Switched to use `display:none` in extra_tags_for_form method.Gaelian Ditchburn2014-01-051-1/+1
| | | | | | | | | | | | | The use of `display:inline` with the content_tag call in the extra_tags_for_form method potentially causes display issues with some browsers, namely Internet Explorer. IE's behaviour of not collapsing the line height on divs with ostensibly no content means that the automatically added div containing the hidden authenticity_token, utf8 and _method form input tags may interfere with other visible form elements in certain circumstances. The use of `display:none` rather than `display:inline` fixes this problem. Fixes #6403
* Label only accepts `:index` and `:namespace` attributes from the inputAndriel Nuernberg2013-12-051-0/+36
|
* handle `:namespace` form option in collection labelsVasiliy Ermolovich2013-09-221-0/+36
|
* form_for - fix :namespace and :as options clashAdam Niedzielski2013-09-091-0/+12
| | | | | | | | :as option should not overwrite :namespace option when generating html id attribute of the form element. id should be prefixed by specified namespace even if :as option is present Add test case showing the issue and code fixing it
* text_area should handle nil value option like text_fieldJoel Cogen2013-07-241-0/+7
|
* Remove `FormBuilder` deprecation warning about block argument and associated ↵Vipul A M2013-07-021-12/+0
| | | | tests
* fetch value(s) from stringified optionsJon Rowe2013-06-291-0/+17
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+2959