aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/asset_tag_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* A type class or nil has to respond_to :to_sAkira Matsuda2019-07-121-2/+1
|
* 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
|
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* Fix unclosed tags [ci skip]yuuji.yaginuma2018-08-181-1/+1
|
* Merge pull request #32471 from janko-m/use-image_processing-gemGeorge Claghorn2018-04-231-2/+2
|\ | | | | Use ImageProcessing gem for ActiveStorage variants
| * Recommend using :resize_to_fit after allJanko Marohnić2018-04-231-2/+2
| |
* | Add the `nonce: true` option for `javascript_include_tag` helper.Yaroslav Markin2018-04-171-0/+8
|/
* Small doc fixesT.J. Schuck2018-04-021-1/+1
| | | | [ci skip]
* Fix `as` attribute value for preload linkbogdanvlviv2018-01-311-1/+1
| | | | | | `as` attribute value should be `style` for stylesheet preload link See https://w3c.github.io/preload/#as-attribute
* Fix typos, update documentationJames Lovejoy2018-01-111-15/+21
| | | | [ci skip]
* Add preload_link_tag helper.Guillermo Iguaran2017-11-281-0/+75
| | | | | | | | | | | This helper creates a link tag with preload keyword that allows to browser to initiate early fetch of resources. Additionally this send Early Hints if supported. See https://github.com/rails/rails/pull/30744/commits/59a02fb7bcbe68f26e1e7fdcec45c00c66e4a065 for more details about Early Hints. Preload spec: https://w3c.github.io/preload/
* Make sure the request exist befoe trying to send early hintsRafael Mendonça França2017-11-281-2/+2
| | | | | | | Action Mailer context for example responds to request but don't have a a request object. Fixes #31265
* [Action View] require_relative => requireAkira Matsuda2017-10-211-2/+2
| | | | This basically reverts c4d1a4efeec6f0b5b58222993aa0bec85a19b6a8
* request checkpavel2017-10-051-2/+2
|
* Implement H2 Early Hints for Railseileencodes2017-10-041-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When puma/puma#1403 is merged Puma will support the Early Hints status code for sending assets before a request has finished. While the Early Hints spec is still in draft, this PR prepares Rails to allowing this status code. If the proxy server supports Early Hints, it will send H2 pushes to the client. This PR adds a method for setting Early Hints Link headers via Rails, and also automatically sends Early Hints if supported from the `stylesheet_link_tag` and the `javascript_include_tag`. Once puma supports Early Hints the `--early-hints` argument can be passed to the server to enable this or set in the puma config with `early_hints(true)`. Note that for Early Hints to work in the browser the requirements are 1) a proxy that can handle H2, and 2) HTTPS. To start the server with Early Hints enabled pass `--early-hints` to `rails s`. This has been verified to work with h2o, Puma, and Rails with Chrome. The commit adds a new option to the rails server to enable early hints for Puma. Early Hints spec: https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04 [Eileen M. Uchitelle, Aaron Patterson]
* Remove `alt` text from `image_tag` example [ci skip]yuuji.yaginuma2017-08-241-3/+3
| | | | Follow up of #30213
* Do not generate default alt text in image tagsCameron Cundiff2017-08-171-13/+9
| | | | | | | | | | | | | | | | | | | | | - Auto-generating content from the filename of an image is not suitable alternative text; alt text that isn't fully considered can be distracting and fatiguing for screen readers users (blind, low vision, dyslexic people). - Setting a filename fallback short circuits screen reader default behavior and configuration for blank descriptions. - Setting poor defaults also creates false negatives for accessibility linting and testing software, that makes it harder to improve application accessibility. *** - After this change, if authors leave images without alt text, screen readers will fallback to default behavior for missing alt text. - Also with this change, Automated linting and testing tools will correctly generate warnings. [Fixes #30096]
* Extend image_tag to accept ActiveStorage Attachments and Variants (#30084)Anton Khamets2017-08-071-2/+23
| | | | | | | | | | | | | | | | | | * Extend image_tag to accept ActiveStorage's Attachments and Variants * Flip resolve_image_source around * Add tests for the new use-cases of image_tag * Remove the higher-level test * Update image_tag documentation * Add error states into the test suite * Re-raise polymorhic_url's NoMethodError as ArgumentError * delegate_missing_to will raise DelegationError instead of NoMethodError
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* Merge branch 'master' into require_relative_2017Xavier Noria2017-07-021-2/+16
|\
| * Avoid shadowed variableMatthew Draper2017-07-021-2/+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.
| * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-021-0/+1
| |\ | | | | | | | | | Enforce frozen string in Rubocop
| | * Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
| | |
| * | Merge pull request #29349 from robertomiranda/responsive-imagesMatthew Draper2017-07-021-2/+16
| |\ \ | | |/ | |/| | | | Add srcset option to image_tag helper
| | * Add `srcset` option to `image_tag` helperRoberto Miranda2017-06-291-1/+15
| |/
* / [Action View] require => require_relativeAkira Matsuda2017-07-011-2/+2
|/
* Add :json type to auto_discovery_link_tagMike Gunderloy2017-05-201-5/+7
| | | | | This allows auto_discovery_link_tag to support the JSON Feed standard. See https://jsonfeed.org/version/1 for more information.
* Fix typo extention -> extension [ci skip]kenta-s2017-01-131-1/+1
|
* Fix grammar in asset tag documentationeileencodes2016-12-201-1/+1
| | | | | Updated the docmentation because "options supports" is not grammatically correct.
* Improve `javascript_include_tag` documentation (#27403)Pablo Ifrán2016-12-201-5/+24
| | | | Add all the available options, and correct the samples of the `javascript_include_tag`.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* let Regexp#match? be globally availableXavier Noria2016-10-271-1/+0
| | | | | | Regexp#match? should be considered to be part of the Ruby core library. We are emulating it for < 2.4, but not having to require the extension is part of the illusion of the emulation.
* remove warning from `video_tag`yuuji.yaginuma2016-09-011-3/+3
| | | | | | | | This removes the following warning. ``` actionview/lib/action_view/helpers/asset_tag_helper.rb:291: warning: shadowing outer local variable - options ```
* Better keyword argument nameschneems2016-08-301-3/+3
|
* Address comment via @dhh, better option namingschneems2016-08-301-8/+8
|
* Document public_poster_folder optionschneems2016-08-291-0/+4
|
* Missed 2 public_* methods in cleanupschneems2016-08-291-16/+0
|
* Favor `public_folder: true` over `public_*`schneems2016-08-291-32/+3
| | | | Adding all those `public_*` methods is a bit heavy handed, we can change the API to instead use `public_folder: true`. Change was pretty easy since it was already implemented that way.
* Fix formattingschneems2016-08-291-8/+8
|
* Add `public_*` helpers to all the `_tag` methods.schneems2016-08-291-10/+58
|
* modernizes hash syntax in actionviewXavier Noria2016-08-061-5/+5
|
* applies new string literal convention in actionview/libXavier Noria2016-08-061-16/+16
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* systematic revision of =~ usage in AVXavier Noria2016-07-251-4/+5
| | | | | Where appropriate, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
* Bring Boolean Attributes list for AV Tags helper upto speed with current spec.Vipul A M2016-06-281-2/+2
| | | | | | | | | 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
* Fix img alt attribute generation when using Sprockets >= 3.0Bart de Water2016-01-271-1/+1
|
* Remove ActionView dependence on ActionPack's Mime implementationJon Moss2016-01-171-1/+1
|
* Example of setting data attributes for image_tagNishant Modak2015-11-201-0/+2
|
* Allow `host` option in javscript and css helpersGrzegorz Witek2015-11-081-2/+2
| | | | | Now both `javascript_include_tag` and `stylesheet_tag` can accept `host` option to provide custom host for the asset