aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused requireKasper Timm Hansen2019-08-051-1/+0
|
* Update sanitizer in ActionView::Helpers::SanitizeHelperJuanito Fatas2019-08-051-21/+13
| | | | | - The sanitizer has been changed to safe_list_sanitizer. - deprecate white_list_sanitizer
* No private defRafael Mendonça França2019-08-011-2/+4
|
* These methods doesn't have to be `protected`Akira Matsuda2019-08-011-4/+2
|
* Use `try` only when we're unsure if the receiver would respond_to the methodAkira Matsuda2019-08-016-7/+6
|
* Merge pull request #36813 from haruyuki97/haruyuki97/fix-comment-in-url-helperPrem Sichanugrist2019-07-301-1/+1
|\ | | | | | | | | Fix a/an usage on `phone_to` documentation. [ci skip]
| * fix a typo [ci skip]haruyuki972019-07-301-1/+1
| |
* | Use match? where we don't need MatchDataAkira Matsuda2019-07-291-1/+1
| |
* | Add AS::TimeZone#match?Akira Matsuda2019-07-291-2/+2
|/
* Use match? where we don't need MatchDataAkira Matsuda2019-07-271-1/+1
| | | | We're already running Performance/RegexpMatch cop, but it seems like the cop is not always =~ justice
* Merge pull request #36178 from sshaw/fix_time_zone_options_priorityRafael França2019-07-261-3/+4
|\ | | | | Update time_zone_options_for_select docs
| * Update time_zone_options_for_select docssshaw2019-05-041-3/+4
| |
* | Added a phone_to helper method, on the style of mail_to and sms_to. (#36775)Pietro Moro2019-07-261-0/+47
| | | | | | | | | | | | | | | | | | | | | | * Added a phone_to helper method, on the style of mail_to and sms_to. It creates an anchor tag with the href set to tel: *here your number* which, when clicked on a mobile phone, or on a desktop with a supported application, lets the phone app kick in, and it prepopulates it with the phone number specified. [Pietro Moro + Rafael Mendonça França]
* | Merge pull request #36467 from spk/add-doc-host-protocol-asset_pathRafael França2019-07-241-0/+2
|\ \ | | | | | | Add documentation on actionview asset_path with host and protocol
| * | Add documentation on actionview asset_path with host and protocolLaurent Arnoud2019-06-121-0/+2
| | |
* | | Fix broken rdoc for UrlHelper [ci skip]Ryuta Kamizono2019-07-241-6/+6
| | | | | | | | | | | | | | | * Fix unintentionally linked String, Symbol, Hash, and ERB. * Fix unintentionally code block.
* | | Fix argument in doc sample of new `sms_to` helper [ci skip]Carlos Antonio da Silva2019-07-191-1/+1
| | |
* | | Merge pull request #36511 from aantix/sms_link_helperGuillermo Iguaran2019-07-191-0/+48
|\ \ \ | | | | | | | | Helper method to create an sms link
| * | | Doc changes.Jim Jones2019-06-181-4/+4
| | | |
| * | | Helper method to create an sms link - when clicked it opens the ↵Jim Jones2019-06-181-0/+48
| |/ / | | | | | | | | | phone/desktop's messaging client with the phone number and optional body value prepopulated.
* | | A type class or nil has to respond_to :to_sAkira Matsuda2019-07-121-2/+1
| | |
* | | Fix TranslationHelper#translate handling of Hash defaultsJean Boussier2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is sometimes expected of the `translate` methods to return a Hash, for instance it's the case of the `number.format` key. As such users might need to specify a Hash default, e.g. `translate(:'some.format', default: { separator: '.', delimiter: ',' })`. This works as expected with the `I18n.translate` methods, however `TranslationHelper#translate` apply `Array()` on the default value. As a result the default value end up as `[:separator, '.', :delimiter, ',']`.
* | | [ci skip] Use default path in button_to documentationAlberto Almagro2019-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is really a nit pick, but as this is the framework's documentation I think it should follow standards as many times as possible to avoid confusion in new users. If we were using `resources :articles` in routes. which is what scaffold adds, the generated helper would be `new_article_path` instead of `new_articles_path`.
* | | Merge pull request #36388 from joelhawksley/actionview-componentAaron Patterson2019-06-131-1/+5
|\ \ \ | | | | | | | | Introduce ActionView::Component
| * | | `RenderingHelper` supports rendering objects that `respond_to?` `:render_in`Joel Hawksley2019-06-121-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Natasha Umer <natashau@github.com> Co-authored-by: Aaron Patterson <tenderlove@github.com> Co-authored-by: Shawn Allen <shawnbot@github.com> Co-authored-by: Emily Plummer <emplums@github.com> Co-authored-by: Diana Mounter <broccolini@github.com> Co-authored-by: John Hawthorn <jhawthorn@github.com> Co-authored-by: Nathan Herald <myobie@github.com> Co-authored-by: Zaid Zawaideh <zawaideh@github.com> Co-authored-by: Zach Ahn <engineering@zachahn.com>
* / / Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-1322-22/+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.
* | Merge pull request #36324 from yoones/fix-unexpected-select-tag-delete-behaviorEileen M. Uchitelle2019-05-281-1/+2
|\ \ | | | | | | Fix unexpected select_tag delete behavior when include_blank is present
| * | Fix select_tag so that is doesn't change options when include_blank is setYounes SERRAJ2019-05-221-1/+2
| |/
* / 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)
* Fixes grammar in comments on tag_name and tag_idMichael Bock2019-04-251-2/+2
|
* url -> URL where apt except inside actionpack/Sharang Dashputre2019-04-012-2/+2
|
* Ruby 2.4 and later support native Unicode case mappingsRyuta Kamizono2019-03-181-1/+1
| | | | Here is only place where we use `mb_chars` internally.
* Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_blockKasper Timm Hansen2019-03-101-2/+2
|\ | | | | Ruby 2.7 warning: creating a Proc without a block
| * Ruby 2.7 warning: creating a Proc without a blockutilum2019-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of [Revision 66772]( https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772) `Proc.new` without giving a block emits `warning: tried to create Proc object without a block`. This commit fixes cases where Rails test suit tickles this warning. See CI logs: https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190 https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159 https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169 https://travis-ci.org/rails/rails/jobs/487205821#L1189 https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416 https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
* | Updated links from http to https in guides, docs, etcAbhay Nikam2019-03-092-2/+2
| |
* | Removes unnecessary dot in regexpXavier Noria2019-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A string S matches ([.]|\b)html if an only if matches \bhtml: * If S matches [.]html, then it matches \bhtml. * If S matches \bhtml, then it matches \bhtml. Reciprocally: * If S matches \bhtml, then it matches ([.]|\b)html. The character class can be removed, and since we are on it we remove the group too so that it is clear to a reader of the code that there is no grouping going on. References #35166.
* | Templates have one formatAaron Patterson2019-02-251-1/+1
| | | | | | | | | | | | | | Templates only have one format. Before this commit, templates would be constructed with a single element array that contained the format. This commit eliminates the single element array and just implements a `format` method. This saves one array allocation per template.
* | rename push / pop functionAaron Patterson2019-02-191-1/+1
| |
* | Merge pull request #35293 from rails/remove-rendered-format-from-cacheAaron Patterson2019-02-191-5/+5
|\ \ | | | | | | Pass the template format to the digestor
| * | Pass the template format to the digestorAaron Patterson2019-02-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit passes the template format to the digestor in order to come up with a key. Before this commit, the digestor would depend on the side effect of the template renderer setting the rendered_format on the lookup context. I would like to remove that mutation, so I've changed this to pass the template format in to the digestor. I've introduced a new instance variable that will be alive during a template render. When the template is being rendered, it pushes the current template on to a stack, setting `@current_template` to the template currently being rendered. When the cache helper asks the digestor for a key, it uses the format of the template currently on the stack.
* | | Allow to pass options to `csp_meta_tag`yuuji.yaginuma2019-02-161-2/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | Currently `csp_meta_tag` generates `name` attribute only. However, in libraries like `Material-UI` and `JSS`, expect that the meta tag that contains the nonce with `property` attribute. https://material-ui.com/css-in-js/advanced/#how-does-one-implement-csp https://github.com/cssinjs/jss/blob/master/docs/csp.md This patch allows `csp_meta_tag` to specify arbitrary options and allows `nonce` to be passed to those libraries.
* / Turn lookup context in to a stack, push and pop if formats changeAaron Patterson2019-02-111-4/+6
|/ | | | | | | | | | | This commit keeps a stack of lookup contexts on the ActionView::Base instance. If a format is passed to render, we instantiate a new lookup context and push it on the stack, that way any child calls to "render" will use the same format information as the parent. This also isolates "sibling" calls to render (multiple calls to render in the same template). Fixes #35222 #34138
* Merge branch 'float_dom_ids'Gannon McGibbon2019-02-051-1/+1
|\ | | | | | | Closes #34975.
| * Fix unique DOM IDs for collection inputsMark Edmondson2019-01-251-1/+1
| |
* | Improve regexp of `html_safe_translation_key?`Kazuhiro NISHIYAMA2019-02-051-1/+1
| | | | | | | | | | | | - Use `\z` instead of `$` - Use character class instead of alternation - Optimize alternation order
* | Prefer ImageProcessing's resize_to_limit macro over resize_to_fitGeorge Claghorn2019-01-241-5/+5
|/ | | | Don't upsize images smaller than the specified dimensions.
* Remove deprecated image_alt helperRafael Mendonça França2019-01-171-23/+0
|
* Fix typo in collection_radio_buttons spec [ci skip]Alberto Almagro2019-01-111-1/+1
|
* Don't expect defined protect_against_forgery? in {token,csrf_meta}_tagGenadi Samokovarov2018-12-272-2/+2
| | | | | | | | | | | | | | | | | | | The `#csrf_meta_tags` and `#token_tag` Action View helper methods are expecting the class in which are included to explicitly define the method `#protect_against_forgery?` or else they will fail with `NoMethodError`. This is a problem if you want to use Action View outside of Rails applications. For example, in #34788 I used the `#button_to` helper inside of the error pages templates that have a custom `ActionView::Base` subclass, which did not defined `#protect_against_forgery?` and trying to call the button failed. I had to dig inside of Action View to find-out what's was going on. I think we should either set a default method implementation in the helpers or check for the method definition, but don't explicitly require the presence of `#protect_against_forgery?` in every `ActionViews::Base` subclass as the errors are hard to figure out.
* Generate doc of methods provided by form builders [ci skip]yuuji.yaginuma2018-12-261-0/+221
| | | | | | | | Because method arguments are different in the methods provided by form helpers and form builders, I think these are necessary to prevent confusion. Fixes #34787