aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/tags
Commit message (Collapse)AuthorAgeFilesLines
* [Action View] require => require_relativeAkira Matsuda2017-07-016-6/+6
|
* Generate field ids in `collection_check_boxes` and `collection_radio_buttons`yuuji.yaginuma2017-06-112-0/+2
| | | | | This makes sure that the labels are linked up with the fields. Fixes #29014
* Move slicing to initializer.Kasper Timm Hansen2017-06-072-2/+2
| | | | | | Forgot all about https://github.com/rails/rails/pull/28844/files#r113780934 cc @rafaelfranca
* Fix select tag helper used with Enumerable choicesSam Pohlenz2017-05-171-1/+1
| | | | | | Allows a custom object implementing Enumerable to be used as the choices parameter for a select tag, which previously wasn't possible due to the call to `empty?` on the choices (which isn't implemented on Enumerable).
* Remove unnecessary `skip_default_ids` and ↵kyuden2017-04-241-1/+1
| | | | `allow_method_names_outside_object` attributes of select tag in `form_with`
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-052-2/+2
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Generate indexed names in input even when objects are not persistedRafael Mendonça França2017-01-031-2/+13
| | | | | | | | | | | | | | When you ask to generate multiple nested inputs using: field_for('comments[]', Comment.new) do |c| c.text_field :body Rails should generated the names like `post[comments][][body]`. To make sure we don't have regression the fake models now use the same implementation of `#to_param` as `ActiveRecord::Base` Fixes #26942
* No need to nodoc private methodsAkira Matsuda2016-12-242-7/+7
|
* Describe what we are protectingAkira Matsuda2016-12-231-0/+2
|
* form_with: allow methods outside the model.Kasper Timm Hansen2016-12-181-3/+14
| | | | | | | | Has the handy effect of making the initial examples in the form_with docs work too. Had to do some finagling such that form_with's without a scope didn't wrap their names in braces ala `[title]`.
* form_with/fields: Don't output ids by defaultKasper Timm Hansen2016-12-132-3/+15
| | | | | | | | | | | Continuing 67f81cc where we decided not to output ids by default in the new form helpers. Went with @dhh's suggestion of just requiring ids on fields being labelled: https://github.com/rails/rails/issues/25197#issuecomment-231797117 Seems okay enough.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-294-6/+6
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-142-6/+6
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* 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
| |