aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_helper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow pass multipart option to form_forGrzegorz Derebecki2013-03-171-2/+2
|
* Stylistic pass at form_helper_testRafael Mendonça França2013-01-211-286/+362
|
* Capture block so content won't leak.José Mota2013-01-211-0/+57
| | | | | | | | | | | | | | The [following pull request](https://github.com/rails/rails/pull/8916) fixed the block being passed to the appropriate helper method. However, the content being passed into the block is generating repeated markup on the page due to some weird ERb evaluation. This commit tries to capture the block's generated output so the page isn't flooded with markup. [Rafael França + José Mota] Closes #8936
* Merge pull request #8916 from josemota/collection-with-blockRafael Mendonça França2013-01-131-0/+49
|\ | | | | | | | | Collection radio buttons and collection check boxes through FormBuilder render the provided block. Closes #8897
| * Collection radio buttons and collection check boxes through FormBuilder renderJosé Mota2013-01-121-0/+49
| | | | | | | | | | | | | | | | the provided block. In the case of having a form_for method being called, the block for each collection would not be passed and thus the result expected was always the same. This patch passes the block to the original method like it would be assumed.
* | Associaton -> AssociationSteve Klabnik2013-01-131-2/+2
|/
* Merge pull request #8623 from virusman/form_helpers_collectionproxy_fixJon Leighton2013-01-111-0/+23
|\ | | | | Fixed nested fields bug when called with AssociationProxy
| * Test nested fields with AssociationProxy mockup & fix AssociationProxy ↵virusman2012-12-271-0/+23
| | | | | | | | support in form helper
* | Do not call fields_for from form_for, to avoid instantiating two buildersCarlos Antonio da Silva2013-01-061-1/+13
|/
* Support :multiple option on input tags with :indexDaniel Fox, Grant Hutchins & Trace Wax2012-11-021-0/+13
| | | | | When you have an explicit index set, then when you build an input tag with :multiple => true, it doesn't add [] to the end of its name, although it should.
* check_box value can be not only an object of Array classVasiliy Ermolovich2012-10-201-0/+6
| | | | there is a chance that `value` is a Set or an object that reponses to `include?` method so let's handle this case
* Create variable only in the test that uses itCarlos Antonio da Silva2012-08-251-3/+3
| | | | | Instead of building a Blog::Post instance for every test in form helper tests, just build it in the test that uses it.
* check for nil or empty record in form_forschneems2012-08-101-0/+14
| | | | if nil or an empty array is passed into form_for you get a horrible error message, this one is much more indicative of what the programmer needs to know to fix the problem.
* Allow data attributes to be set as a first-level option for form_for, so you ↵David Heinemeier Hansson2012-08-081-0/+6
| | | | can write `form_for @record, data: { behavior: 'autosave' }` instead of `form_for @record, html: { data: { behavior: 'autosave' } }` *DHH*
* removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-1/+1
| | | | | | | | | | | | | | | | | | | by Active Support) Selecting which key extensions to include in active_support/rails made apparent the systematic usage of Object#in? in the code base. After some discussion in https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d we decided to remove it and use plain Ruby, which seems enough for this particular idiom. In this commit the refactor has been made case by case. Sometimes include? is the natural alternative, others a simple || is the way you actually spell the condition in your head, others a case statement seems more appropriate. I have chosen the one I liked the most in each case.
* load active_support/core_ext/object/inclusion in active_support/railsXavier Noria2012-08-021-1/+0
|
* fix meaningless test caseAkira Matsuda2012-06-061-1/+1
| | | | | Module#instance_methods returns an Array of Symbols in Ruby >= 1.9 So this was not actually testing anything
* accept a block in button helper.Yuki Nishijima2012-06-051-1/+5
|
* Add tests for time_field and date_field helpersCarlos Galdino2012-05-221-0/+18
| | | | These tests check the values of 'min' and 'max' input attrs
* Add several HTML5 input helpersCarlos Galdino2012-05-211-0/+140
| | | | | | | | | | | | The input types added are: - input[type="month"] - input[type="week"] - input[type="datetime"] - input[type="datetime-local"]
* Add HTML5 input[type="color"] helperCarlos Galdino2012-05-211-0/+13
|
* Add HTML5 input[type="time"] helperAlex Soulim2012-05-181-0/+26
|
* Change check_box to work inverting the checked and unchecked valueRafael Mendonça França2012-04-291-2/+98
| | | | | | | | | | This fixes: * Boolean with inverted logic * Integer with inverted logic * BigDecimal with inverted logic Fixes #3995
* Lazy load `default_form_builder` if it's passed as a stringPiotr Sarnacki2012-04-281-0/+17
| | | | closes #3341
* Remove default match without specified methodJose and Yehuda2012-04-241-1/+1
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
* Add index method to FormBuilder. Useful when you use field_for and need to ↵Jorge Bejar2012-04-111-0/+50
| | | | know the index number into the iteration.
* Block version of label should wrapped in field_with_errors in case of errorAlexey Vakhov2012-04-011-0/+14
|
* Check if the options hash already exists and merge it with the anotherRafael Mendonça França2012-03-271-6/+18
| | | | | | hash. Closes #2492 and #5615
* Fixing issue #2492 for master branch. ActionView::Base.field_error_proc ↵Andrey Samsonov2012-03-271-0/+22
| | | | | | | | doesn't call for label. objectify_options method should be applied to the proper options arg. See explanation and example of the bug - https://github.com/kryzhovnik/rails_field_error_proc_bug_example
* Remove warning added by my own commit :fire:Carlos Antonio da Silva2012-03-261-1/+1
| | | | Commit: 7a0cf2f5294e8bcef547642435636b394340a3e4
* Merge pull request #5561 from carlosantoniodasilva/form-builder-block-argAaron Patterson2012-03-261-0/+12
|\ | | | | Properly deprecate the block argument in AV FormBuilder
| * Properly deprecate the block argument in AV FormBuilderCarlos Antonio da Silva2012-03-231-0/+12
| | | | | | | | | | | | | | | | | | Commit 56089ca986c767763f29159c8de0aa1ebabfd4d2 introduced a backward incompatible change by changing the method signature of the FormBuilder. This brings back the same method signature warning in case someone gives a block to the builder. More info: https://github.com/rails/rails/commit/56089ca986c767763f29159c8de0aa1ebabfd4d2#commitcomment-1116166
* | apply form_for namespace option to date_selectSergey Nartimov2012-03-261-0/+8
|/
* add include_hidden option to checkbox tagSergey Nartimov2012-03-131-0/+5
|
* Fixes #5324 by removing default size options from input:text and default ↵Philip Arndt2012-03-101-162/+162
| | | | cols and rows options from textarea.
* Add a new line after the textarea opening tag.Rafael Mendonça França2012-02-271-36/+36
| | | | Closes #393
* Fix collection_check_boxes and collection_radio_buttons when using localRafael Mendonça França2012-02-261-0/+38
| | | | variables in the form builder
* Move all the helpers to protected sectionRafael Mendonça França2012-02-261-31/+31
|
* uses PATCH for the forms of persisted records, and routes PATCH and PUT to ↵Xavier Noria2012-02-241-69/+66
| | | | the update action of resources
* correct fetching :name option in form fieldsVasiliy Ermolovich2012-02-231-0/+5
|
* Add config.default_method_for_update to support PATCHDavid Lee2012-02-221-0/+9
| | | | | | | | | | | | | | | | PATCH is the correct HTML verb to map to the #update action. The semantics for PATCH allows for partial updates, whereas PUT requires a complete replacement. Changes: * adds config.default_method_for_update you can set to :patch * optionally use PATCH instead of PUT in resource routes and forms * adds the #patch verb to routes to detect PATCH requests * adds #patch? to Request * changes documentation and comments to indicate support for PATCH This change maintains complete backwards compatibility by keeping :put as the default for config.default_method_for_update.
* Add HTML5 input[type="date"] helperOlek Janiszewski2012-02-121-0/+26
|
* Replicate :form html5 attribute to hidden field for check_boxCarlos Antonio da Silva2012-02-021-3/+10
| | | | | When the new html5 attribute :form is given to the check_box helper, it should be replicated to the hidden field as well. Closes #4848
* check_box with nil as unchecked value should be HTML safeRafael Mendonça França2012-01-311-0/+4
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Do not generate label for attribute when giving nilCarlos Antonio da Silva2012-01-261-0/+4
|
* Raise a better error if anyone wants to create your own ↵Rafael Mendonça França2012-01-231-0/+8
| | | | ActionView::Helpers::Tags::Base child and do not implement the render method
* Adding one test case for label with blockRafael Mendonça França2012-01-171-0/+4
|
* use stub instead of redefining method to suppress warningsSergey Nartimov2012-01-071-2/+2
|
* don't set the hidden checkbox value if it's nilDamien Mathieu2012-01-061-0/+8
|
* Do not stub id hereSantiago Pastorino2012-01-061-6/+6
|