aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
Commit message (Collapse)AuthorAgeFilesLines
* Tiny documentation fixes [ci skip]Robin Dupret2016-07-041-4/+9
| | | | | | Fix a link to use RDoc syntax and make sure that the titles' level match the section we are in since we are both documenting the new and the legacy syntax.
* Merge pull request #25553 from vipulnsward/25543-docs-follow-upVipul A M2016-06-301-16/+7
|\ | | | | 25543 docs cleanup
| * - Tone down documentationVipul A M2016-06-281-16/+7
| | | | | | | | | | | | | | - Remove repetative docs - Fix grammar on sentences - Add escaping for literals [ci skip]
* | Add dup leftover from 26710ab.Kasper Timm Hansen2016-06-281-1/+1
| |
* | Default to frozen string literals in TagHelper.Kasper Timm Hansen2016-06-281-5/+7
| | | | | | | | Removes littering `freeze` calls with Ruby 2.3's magic comment.
* | Merge pull request #25555 from vipulnsward/boolean-attributes-updateRafael França2016-06-282-8/+11
|\ \ | | | | | | Bring Boolean Attributes list for AV Tags helper upto speed with current spec
| * | Bring Boolean Attributes list for AV Tags helper upto speed with current spec.Vipul A M2016-06-282-8/+11
| |/ | | | | | | | | | | | | | | | | This is based on https://github.com/kangax/html-minifier/blob/6b2d4536d82819143b468b41a89c700b6c61631f/src/htmlminifier.js#L197 and spec from https://www.w3.org/TR/html51/single-page.html. Couple of other changes to tests due to support update: - autobuffer has been dropped in favour of preload attribute, ref: https://msdn.microsoft.com/en-us/library/ff974743(v=vs.85).aspx - pubdate attribute has been dropped from spec, ref: https://www.w3.org/html/wg/tracker/issues/185
* | Merge pull request #25551 from vipulnsward/25543-follow-upKasper Timm Hansen2016-06-281-1/+1
|\ \ | | | | | | Expand list of void elements to match spec
| * | Expand list of void elements to match spec from ↵Vipul A M2016-06-281-1/+1
| |/ | | | | | | https://html.spec.whatwg.org/multipage/syntax.html#void-elements
* / Freeze string for default content for tag_strings, which later goes on to ↵Vipul A M2016-06-281-1/+1
|/ | | | create new content. This should also be inline with content being passed should not be mutable
* Document `simple_format` handling of `\r`Derek Prior2016-06-271-4/+5
| | | | | | | `simple_format` handles `\r\n` and `\r` but previously did not document this behavior. The handling is done with a `gsub` in `split_paragraphs`. [ci skip]
* New syntax for tag helpers i.e. tag.br instead of tag(br) #25195Marek2016-06-273-59/+176
|
* Fix typo in exception class nameCédric Félizard2016-06-261-1/+1
|
* Merge pull request #25287 from marekkirejczyk/fix_25267Godfrey Chan2016-06-251-1/+1
|\ | | | | Make select_year work with include_position: true option, fix #25267
| * Make select_year work with include_position: true option, fix #25267Marek2016-06-051-1/+1
| |
* | 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
|