aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/number_helper.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.
* Correct human file size examples [ci skip]Alexander Graul2019-05-201-1/+1
| | | | | | | | | | The `number_to_human_size` helpers in Action View and Active Support calculate the "human size" with a base of 1024. The examples should reflect that so they don't confuse the reader. The updated documentations use the values from: helper.number_to_human_size(1500)
* Add missing documentation options to number_to_currency [ci skip]emaxi2018-07-111-0/+5
|
* 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
|
* Fix grammar 'an hyphen' -> 'a hyphen' [ci skip]kenta-s2017-01-251-1/+1
|
* Add missing option on numbers helperPablo Ifran2016-12-171-0/+6
| | | | | The `delimiter_pattern` option was not present on the documentaion of the helper.
* applies remaining conventions across the projectXavier Noria2016-08-061-2/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-38/+38
|
* applies new string literal convention in actionview/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* remove deprecated `:prefix` option from doc [ci skip]yuuji.yaginuma2016-06-091-2/+0
| | | | The option was deprecated in #21191.
* `number_to_phone` formats number with regexpPan GaoYong2016-04-021-1/+8
| | | | | | | | | | | | By default, this method formats US number. This commit extends its functionality to format number for other countries with a custom regular expression. number_to_phone(18812345678, pattern: /(\d{3})(\d{4})(\d{4})/) # => 188-1234-5678 The output phone number is divided into three groups, so the regexp should also match three groups of numbers.
* Merge pull request #22759 from akshay-vishnoi/human-size-helperEileen M. Uchitelle2015-12-271-0/+2
|\ | | | | Add support for Petabyte and Exabyte in number to human size
| * Add support for Petabyte and Exabyte in number to human sizeAkshay Vishnoi2015-12-221-0/+2
| |
* | Add caveat to number_to_currency docs [ci skip]Derek Prior2015-12-231-0/+8
|/ | | | | | | | | | | | | | I've worked on a few applications that have gone through the internationalization process and had issues because they were using `number_to_currency`. The minute a user is allowed to change their locale, they can change the price displayed on a page from 10 US dollars to 10 Mexican Pesos, which is far from the same amount of money. Unlike other helpers that rely on i18n, `number_to_currency` does not produce equivalent results when the locale is changed. As I've explained this to a few groups of developers now, I thought it might make for a good caveat in the docs.
* Correcting output of `number_to_percentage` example in `number_helper` [ci skip]amitkumarsuroliya2015-09-221-1/+1
| | | Here is correct output of `number_to_percentage(100, format: "%n %”)`
* :scissors: empty line at the top of filesAkira Matsuda2015-09-211-1/+0
|
* [ci skip] Fix typo you/yourclaudiob2015-05-231-1/+1
|
* Fix spelling [ci skip]Yu Haidong2015-03-041-8/+8
|
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Fix doc markup for `NumberHelper` [ci skip]Ryunosuke SATO2014-10-291-5/+5
| | | | | The character "*" is unnecessary in option candidates. This incorrect markup was injected in e8c9aeca .
* [ci skip] Add Docs for strip_insignificant_zeros option in number helpersAkshay Vishnoi2014-06-101-10/+8
|
* [ci skip] Correct output and use valid options of number helpersAkshay Vishnoi2014-06-101-2/+2
|
* Escape format, negative_format and units options of number helpersRafael Mendonça França2014-02-181-5/+14
| | | | | | | Previously the values of these options were trusted leading to potential XSS vulnerabilities. Fixes: CVE-2014-0081
* Fix documentation of number_to_currency helperRafael Mendonça França2013-12-041-4/+4
| | | | | | | | | | Now users have to explicit mark the unit as safe if they trust it. Closes #13161 Conflicts: actionpack/lib/action_view/helpers/number_helper.rb actionpack/test/template/number_helper_i18n_test.rb
* Escape the unit value provided to number_to_currencyMichael Koziarski2013-12-021-0/+1
| | | | | | Previously the unit values were trusted leading to potential XSS vulnerabilities. Fixes: CVE-2013-6415
* Make the method name the first argumentRafael Mendonça França2013-11-091-7/+7
| | | | | This is the only argument that changes over the method calls so it is better to it be the first one
* Extract common code from number helpers to new delegator method.Vipul A M2013-11-091-30/+13
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+441