aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
Commit message (Collapse)AuthorAgeFilesLines
* Change datetime to datetime-local helper tagHerminio Torres2016-06-213-55/+11
| | | | | | | | | | | 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-212-33/+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
* Explicitly require `acts_like` in AVSean Griffin2016-06-131-0/+1
| | | | | | This method is used in `distance_of_time_in_words` Fixes #25357
* remove deprecated `:prefix` option from doc [ci skip]yuuji.yaginuma2016-06-091-2/+0
| | | | The option was deprecated in #21191.
* Fix a typo in `time_field` [ci skip]Jake Worth2016-06-051-1/+1
|
* Confirm with the specification when generating emtpy option for select with ↵Vipul A M2016-05-211-1/+3
| | | | | | | | | | | | `include_blank: true` option. We now generate option with empty label, example: `<select id="places" name="places"><option value="" label=" "></option></select>` for include_blank: true. This is only done, if content is missing on the option, and we providing the value from this option. Fixes #24816
* `md5` --> `MD5`Jon Moss2016-05-171-3/+3
| | | | | Sorry, I missed a few places in my last PR. This should be the last of 'em :grimacing:
* Fix example for css_class_attribute and fix indentationPrathamesh Sonpatki2016-04-201-6/+6
|
* [ci skip] Small grammar fixAbhishek Jain2016-04-201-1/+1
|
* Merge pull request #20625 from Envek/add_country_zones_methodJeremy Daer2016-04-191-4/+5
|\ | | | | | | Add ActiveSupport::TimeZone.country_zones helper
* \ Merge pull request #24225 from ↵Rafael Mendonça França2016-04-201-3/+19
|\ \ | | | | | | | | | | | | | | | neumayr/date_select_helper_with_css_classes_accept_hash date_select helper with_css_classes option also accept a hash
| * | date_select helper with_css_classes option also accept a hashneumayr2016-04-051-3/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `date_select` helper `:with_css_classes` option now accepts a hash of strings for `:year`, `:month`, `:day`, `:hour`, `:minute`, `:second` that will extend the select type with the given css class value. ```erb <%= f.date_select :birthday, with_css_classes: { month: "my-month", year: "my-year" } %> ``` ```html <select id="user_birthday_3i" name="user[birthday(3i)]">…</select> <select id="user_birthday_2i" name="user[birthday(2i)]" class="my-month">…</select> <select id="user_birthday_1i" name="user[birthday(1i)]" class="my-year">…</select> ``` Optional, add global `html_options` to modify every select tag in the set. ```erb <%= f.date_select :birthday, with_css_classes: { month: "my-month", year: "my-year" }, { class: "my-date optional" } %> ``` Supported DateHelper methods: `select_day`, `select_month`, `select_year`, `select_hour`, `select_minute`, `select_second`, `select_datetime`, `select_time`, `time_select`, `date_select` and `datetime_select`. `:with_css_classes` option was added to the `date_select` with #7975.
* | Merge pull request #23869 from oreoshake/to-sentence-html-safetyRafael França2016-04-201-0/+30
|\ \ | |/ |/| Add html_safe support to ActionView Array#OutputSafetyHelper
| * mimic ActiveSupport's Array#to_sentence in an html_safe-aware wayNeil Matatall2016-03-151-0/+30
| |
* | `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 #24379 from Gaurav2728/sanitizer-helper-update-docKasper Timm Hansen2016-03-311-1/+1
|\ \ | | | | | | sanitiser helper may be remove in 5.1, update doc [ci skip]
| * | sanitiser helper may be remove in 5.1, update doc [ci skip]Gaurav Sharma2016-03-311-1/+1
| | | | | | | | | using `rails-html-sanitizer` gem still Rails providing strip_tags, strip_links features. May be remove in 5.1
* | | Deprecate `datetime_field` and `datetime_field_tag` helpers.Wojciech Wnętrzak2016-03-312-0/+8
|/ / | | | | | | | | Datetime input type was removed from HTML specification. One can use `datetime_local_field` and `datetime_local_field_tag` instead.
* | fix a comment in atom_feed_helper.rb白井 健太2016-03-161-1/+1
| |
* | - Freeze strings in frequent used private methodStan Lo2016-03-081-11/+11
| | | | | | | | | | reduce string allocation. - Use freezed empty string instead of create one every time we need to return it
* | Revert "Merge pull request #22764 from ↵Rafael Mendonça França2016-03-051-2/+0
|/ | | | | | | | | | stevenspiel/titleize_model_name_for_default_submit_button_value" This reverts commit 4158974c60d817c9bc1e2aecb342161295f2ac0d, reversing changes made to 3d590add45b7ff1de972d99b076cb504d5208935. Reason: This break i18n in some languages. See https://github.com/rails/rails/issues/791#issuecomment-192724640
* We are calling `to_s` in the method so we can call downcase nowRafael Mendonça França2016-02-221-3/+3
|
* Make per form token work when method is not providedRafael Mendonça França2016-02-221-1/+2
| | | | | | When `button_to 'Botton', url` form was being used the per form token was not correct because the method that is was being used to generate it was an empty string.
* Do not pass more options that are needed.Rafael Mendonça França2016-02-221-1/+1
| | | | | We only need action and method so pass them explicitly instead of merging the hash with HTML options.
* Merge pull request #23752 from vipulnsward/23524-fix-button_to_deleteRafael Mendonça França2016-02-221-1/+1
|\ | | | | | | Fixed passing of delete method on button_to tag, creating wrong form csrf token
| * Refactored Request Forgery CSRF PerFormTokensController tests and DRY'ed ↵Vipul A M2016-02-221-1/+1
| | | | | | | | them up.
| * Fixed passing of delete method on button_to tag, creating wrong form csrf tokenVipul A M2016-02-211-2/+2
| | | | | | | | Fixes #23524
* | [ci skip] Document collection caching better.Kasper Timm Hansen2016-02-211-2/+15
| | | | | | | | | | | | | | | | Why are we here? Where did we come from? Where are we going... in 5 minutes? These questions are not answered in this documentation. Instead collection caching is better clarified. How it works, how it can share caches with individual templates.
* | Merge pull request #23695 from kaspth/remove-automatic-collection-cachingKasper Timm Hansen2016-02-201-35/+7
|\ \ | |/ |/| Make collection caching explicit.
| * Make collection caching explicit.Kasper Timm Hansen2016-02-201-35/+7
| | | | | | | | | | | | | | | | | | | | | | | | Having collection caching that wraps templates and automatically tries to infer if they are cachable proved to be too much of a hassle. We'd rather have it be something you explicitly turn on. This removes much of the code and docs to explain the previous automatic behavior. This change also removes scoped cache keys and passing cache_options.
* | Merge pull request #17043 from jcoleman/fix-nested-params-in-button-toRafael França2016-02-191-2/+38
|\ \ | |/ |/| Fix button_to's params option to support nested names.
| * Fix button_to's params option to support nested names.James Coleman2016-02-191-2/+38
| | | | | | | | | | | | In e6e0579defcfcf94ef1c4c1c7659f374a5335cdb the `params` option was added to the `button_to` helper. However, the patch doesn't support nested hashes so `{a: {b: 'c'}}` for example gets turned into a hidden form input with the name 'a' and the value being the string representation of the `{b: 'c'}` nested hash. Since Rails supports nested hashes everywhere else (and even in the URL params of link_to and button_to), I believe this to be a bug/unfinished feature.
* | Test to check if the data-attr if nil is same or notSourav Moitra2016-02-141-0/+1
|/ | | | | | | | | | if data attribute is nil it is ignored if value is nil the pair is ignored if value is nil it is skipped Improved test for data attr nil
* Slice out options for cache_fragment_name explicitlyRyan Bigg2016-01-281-1/+2
| | | | This allows expire_in (and other options) to be passed to the cache method
* Fix img alt attribute generation when using Sprockets >= 3.0Bart de Water2016-01-271-1/+1
|
* Fix doc [ci skip]Daniel Gomez de Souza2016-01-271-1/+1
|
* html_safe is not supposed to be public API for AV. This change removes usage ↵Vipul A M2016-01-203-10/+10
| | | | | | of html_safe in favour of raw() in AV helpers. Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw()
* Remove ActionView dependence on ActionPack's Mime implementationJon Moss2016-01-171-1/+1
|
* Merge pull request #20638 from jaimeiniesta/locale-aware-pluralize-helperKasper Timm Hansen2016-01-101-7/+14
|\ | | | | Pass the current locale to Inflector from the pluralize text helper.
| * Pass the current locale to Inflector from the pluralize text helper.Jaime Iniesta2016-01-101-7/+14
| | | | | | | | | | | | | | | | | | | | | | The pluralize text helper uses the Inflector to determine the plural form. The inflector accepts an optional parameter for the locale, so we can pass it from the text helper to have locale-aware pluralizations on the text helpers level. The pluralize text helper now only accepts 2 positional arguments: `count` and `singular`. Passing `plural` as a positional argument is now deprecated.
* | [ci skip] fix typoAkshay Vishnoi2016-01-101-1/+1
| |
* | [doc] The capture method isn't always used inside views to create a variableAkira Matsuda & saya2016-01-081-2/+2
| | | | | | | | | | but rather very often used inside helpers to directly return a String value. [ci skip]
* | add option for per-form CSRF tokensBen Toews2016-01-042-5/+15
| |
* | Merge pull request #22764 from ↵Rafael França2016-01-041-0/+2
|\ \ | | | | | | | | | | | | stevenspiel/titleize_model_name_for_default_submit_button_value titleize the model name on default submit buttons
| * | downcase default submit button value's model nameSteven Spiel2016-01-011-0/+2
| | |
* | | Fix collection_radio_buttons' hidden_field name and make it appear before ↵Santiago Pastorino2015-12-312-2/+10
| | | | | | | | | | | | | | | | | | the radios Fixes #22773
* | | 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
| |/ /
* | | fix TypeError when using submit_tag with Symbol valueyuuji.yaginuma2015-12-241-1/+1
| | |
* | | 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.