aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/tags
Commit message (Collapse)AuthorAgeFilesLines
* Add three new rubocop rulesRafael Mendonça França2016-08-162-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-069-233/+233
|
* modernizes hash syntax in actionviewXavier Noria2016-08-065-10/+10
|
* applies new string literal convention in actionview/libXavier Noria2016-08-069-11/+11
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* New syntax for tag helpers i.e. tag.br instead of tag(br) #25195Marek2016-06-271-2/+2
|
* Fix typo in exception class nameCédric Félizard2016-06-261-1/+1
|
* Change datetime to datetime-local helper tagHerminio Torres2016-06-211-1/+1
| | | | | | | | | | | A change was made in the helper that renders the `datetime`, being now by default `datetime-local` and creating an alias of `datetime-local` for `datetime`, `datetime` tag and it passes to be an abstract class for all other tags that inherit from him. As a new specification of the HTML 5 the text field type `datetime` will no longer exist and will pass a `datetime-local`. Ref: https://html.spec.whatwg.org/multipage/forms.html#local-date-and-time-state-(type=datetime-local)
* Revert "Merge pull request #17973 from maurogeorge/file_field_hidden_field"eileencodes2016-06-211-15/+0
| | | | | | | | | | | | | The reason we are reverting this commit is because it created breaking changes for file upload gems. For more information see discussion here: https://github.com/rails/rails/issues/17947#issuecomment-225154294 This reverts commit c455817804e4df64c46c17a0cdec0e5a1ca5ba2e, reversing changes made to 8b3cd74b8a09ef85a43d7631bb062a9ec7f57227. Conflicts: actionview/CHANGELOG.md actionview/lib/action_view/helpers/form_helper.rb
* Fix doc [ci skip]Daniel Gomez de Souza2016-01-271-1/+1
|
* Fix collection_radio_buttons' hidden_field name and make it appear before ↵Santiago Pastorino2015-12-312-2/+10
| | | | | | the radios Fixes #22773
* Fix week_field returning invalid valueChristoph2015-11-101-1/+1
| | | | | | | According to the W3 spec[1] the value should use a 1-based index and not a 0-based index for the week number. [1]: http://www.w3.org/TR/html-markup/datatypes.html#form.data.week
* Collection check boxes propagates input's id to the label's for attribute.Vasiliy Ermolovich2015-10-201-0/+2
|
* Add a hidden field on the collection_radio_buttonsMauro George2015-09-243-32/+29
| | | | | This will avoid a error be raised when the only input on the form is the `collection_radio_buttons`.
* Raise an ArgumentError when `include_blank` is false for a required field inGrey Baker2015-06-081-3/+9
| | | | | | | | | | `Tags::Base#select_content_tag`. Previously, passing a falsey value to `include_blank` would be ignored if the field was required, and a blank line would still be inserted. The following will now raise instead of quietly failing: `select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
* Merge pull request #18845 from bogdan/remove-code-dups-in-action-viewRafael Mendonça França2015-02-112-33/+25
|\ | | | | Remove some code duplication in ActionView tags code
| * Remove code duplication in ActionView::Helpers::Tags::BaseBogdan Gusiev2015-02-112-33/+25
| |
* | Remove warning from ActionView::Helpers::Tags::TranslatorYuki Nishijima2015-02-081-1/+3
|/ | | | | | This removes the following warning: /GitHub/rails/actionview/lib/action_view/helpers/tags/translator.rb:19: warning: private attribute?
* Fixed undefined method `i18n_key' for nil:NilClass for labels in non AR form_forMiklos Fazekas2015-02-061-1/+1
| | | | | 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)
* Rename method to make explicit its intentionRafael Mendonça França2015-02-053-3/+3
| | | | call is too generic
* Use kwags to make the argument meaning explicitRafael Mendonça França2015-02-053-6/+6
|
* Use new hash syntaxRafael Mendonça França2015-02-051-1/+1
|
* Change the method visibilityRafael Mendonça França2015-02-051-2/+4
| | | | Thse methods are used only inside this class
* Only check if object respond_to to_model onceRafael Mendonça França2015-02-051-6/+2
|
* placeholder doesn't exist inside this contextRafael Mendonça França2015-02-051-2/+2
|
* Reduce duplication when generating translationsMaarten Claes2015-01-223-34/+46
|
* Convert with `to_model` before calling ActiveModel methods on `object`Maarten Claes2015-01-222-8/+14
|
* Only use the `_before_type_cast` in the form when from user inputSean Griffin2015-01-141-2/+9
| | | | | | 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.
* Revert "Don't use the `_before_type_cast` version of attributes in the form"Sean Griffin2015-01-143-2/+12
| | | | This reverts commit 787e22bb491bd8c36db1e9734261c4ce02c5c5fd.
* Don't use the `_before_type_cast` version of attributes in the formSean Griffin2015-01-143-12/+2
| | | | | | | | | | | 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-0/+15
|\ | | | | | | Generate a hidden_tag when using a file_field
| * Add a hidden_field on the file_fieldMauro George2015-01-021-0/+13
|/ | | | | This will avoid a error be raised when the only input on the form is the `file_field`.
* Remove block from superJose Añasco2014-12-232-10/+12
|
* Fix options overwritten by superJose Añasco2014-12-092-11/+10
|
* Honor public/private in ActionView::Helpers::Tags::Base#valueTobias Pfeiffer2014-10-311-1/+1
| | | | | * use public_send instead of send to avoid calling private methods in form helpers
* Merge pull request #16488 from agrobbin/form-label-builderJeremy Kemper2014-08-251-22/+46
|\ | | | | 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-22/+46
| |
* | just use the placeholder tag value if it is passed as a StringAlex Robbin2014-08-221-1/+3
| |
* | add I18n support for `:placeholder` HTML option is passed to form fieldsAlex Robbin2014-08-223-0/+40
| |
* | Revert "Add I18n support for `:placeholder` HTML option is passed to form ↵Jeremy Kemper2014-08-213-40/+0
|/ | | | fields"
* Merge pull request #15889 from carnesmedia/model-nameRafael Mendonça França2014-08-171-1/+1
|\ | | | | | | Use #model_name on instances instead of classes
| * Use #model_name on instances instead of classesAmiel Martin2014-06-241-1/+1
| | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
* | add I18n support for `:placeholder` HTML option is passed to form fieldsAlex Robbin2014-08-123-0/+40
| |
* | Fixed #select form builder helper to support block with html outputBogdan Gusiev2014-08-051-1/+1
| |
* | Use if/elseRafael Mendonça França2014-06-301-2/+5
| | | | | | | | | | Since we are using both branches of the code is preferable to use if/else over the early return.
* | Add String support for min/max attributes on DatetimeFieldTodd Bealmear2014-06-301-2/+7
|/
* In actionview, eliminate calls to tag that use html_safe parameter values. ↵Paul Grayson2014-06-131-1/+0
| | | | This is generally unnecessary, since tag handles string quoting, except in one case (utf8_enforcer_tag) where we want to specify the encoding ourselves.
* Include label value in i18n attribute lookupJoshua Cody2014-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | 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".
* `collection_check_boxes` respects `:index` option for the hidden filed name.Vasiliy Ermolovich2014-04-141-4/+13
| | | | closes #14147
* CollectionHelpers now accepts a readonly optionMauro George2014-04-121-1/+1
|
* Merge pull request #12662 from nashby/include-hidden-collectionRafael Mendonça França2014-03-151-3/+7
|\ | | | | | | | | | | | | | | add include_hidden option to collection_check_boxes helper Conflicts: actionview/CHANGELOG.md actionview/test/template/form_collections_helper_test.rb