aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/tags/label.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-1/+0
| | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Change `form_with` to generates ids by defaultnpezza932017-11-251-4/+0
| | | | | | | | | | When `form_with` was introduced we disabled the automatic generation of ids that was enabled in `form_for`. This usually is not an good idea since labels don't work when the input doesn't have an id and it made harder to test with Capybara. You can still disable the automatic generation of ids setting `config.action_view.form_with_generates_ids` to `false.`
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* form_with/fields: Don't output ids by defaultKasper Timm Hansen2016-12-131-0/+4
| | | | | | | | | | | 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.
* Rename method to make explicit its intentionRafael Mendonça França2015-02-051-1/+1
| | | | call is too generic
* Use kwags to make the argument meaning explicitRafael Mendonça França2015-02-051-1/+1
|
* Reduce duplication when generating translationsMaarten Claes2015-01-221-17/+3
|
* Convert with `to_model` before calling ActiveModel methods on `object`Maarten Claes2015-01-221-3/+7
|
* provide a builder for form labels to customize wrapping around I18n contentAlex Robbin2014-08-201-22/+46
|
* 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
* 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".
* Fix ActionView label translation for more than 10 nested elementsVladimir Krylov2014-02-241-1/+1
|
* Label only accepts `:index` and `:namespace` attributes from the inputAndriel Nuernberg2013-12-051-1/+0
|
* handle `:namespace` form option in collection labelsVasiliy Ermolovich2013-09-221-0/+1
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+65