aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/form_tag_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix select_tag generating tag when set to false.Guo Xiang Tan2014-11-211-0/+6
| | | | Fixes https://github.com/rails/rails/issues/17701.
* Use new hash syntaxRafael Mendonça França2014-10-251-1/+1
|
* :scissors:Rafael Mendonça França2014-10-251-1/+1
|
* Merge pull request #17064 from frenkel/fix_select_tag_include_blankRafael Mendonça França2014-10-251-0/+6
|\ | | | | Use include_blank value as option label
| * Use include_blank value as option labelFrank Groeneveld2014-10-171-0/+6
| | | | | | | | Update select_tag to reflect documentation and behave the same as form builder select. If the value of include_blank is not boolean true, use that value as the option label.
* | Fix how file_ and password_field_tag edit optionsclaudiob2014-10-151-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the behavior of `file_field_tag` and `password_field_tag` when invoked with a hash of options. These two helpers are different from all the other ones in that they modify the options hash passed as a parameter, whereas all the other helpers duplicate it before updating it. The result is that *bad things* can happen if the user re-uses the same hash. For instance, users who write the following code to display a file field followed by a text field (both with the same class): ```rhtml <% options = {class: 'important'} %> <%= file_field_tag 'Upload', options %> <%= text_field_tag 'Name', options %> ``` would instead see **two file fields!** ```html <input class="important" id="Upload" name="Upload" type="file"> <input class="important" id="Name" name="Name" type="file" value="value"> ``` This PR replaces `update` with `merge` in the code of the two helpers, fixing the issue above. The included test verifies the change, since it passes after this PR, but fails before with the following error: ``` Expected: <input type="text" name="title" id="title" value="Hello!" class="important" /> Actual: <input type="password" name="title" id="title" value="Hello!" class="important" /> ```
* We don't need loofah for the assertionsRafael Mendonça França2014-07-151-1/+1
| | | | We can just use nokogiri
* Replaced html-scanner with Loofah.Timm2014-06-151-1/+1
|
* Remove wrapping div with inline styles for hidden form fields.Joost Baaij2014-04-141-5/+8
| | | | | | 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.
* fixes default attributes for button_tagSergey Prikhodko2014-03-031-0/+5
|
* 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
* Added an `enforce_utf8` hash option for `form_tag` methodTakayuki Matsubara2013-07-071-1/+16
| | | | | | | | | | | | | | | | | | Control to output a hidden input tag with name `utf8` without monkey patching Before: form_tag # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>' After: form_tag # => '<form>..<input name="utf8" type="hidden" value="&#x2713;" />..</form>' form_tag({}, { :enforce_utf8 => false }) # => '<form>....</form>'
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+614