Merge pull request #49925 from akhilgkrishnan/add-missing-methods-in-view-helper-guide

Add missing audio_tag, favicon_link_tag, video_tag methods in ActionView helper guide [ci skip]
This commit is contained in:
Vipul A M 2023-11-20 17:57:17 +05:30 committed by GitHub
commit 21b72e437e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -33,6 +33,16 @@ image_tag("rails.png")
[`config.asset_host`]: configuring.html#config-asset-host
#### audio_tag
Generate an HTML audio tag with source(s), either as a single tag for a string source or nested source tags within an array for multiple sources.
The `sources` can be full paths, files in your public audios directory, or Active Storage attachments.
```ruby
audio_tag("sound")
# => <audio src="/audios/sound"></audio>
```
#### auto_discovery_link_tag
Returns a link tag that browsers and feed readers can use to auto-detect an RSS, Atom, or JSON feed.
@ -42,6 +52,15 @@ auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", { title: "RSS F
# => <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed.rss" />
```
#### favicon_link_tag
Returns a link tag for a favicon managed by the asset pipeline. The `source` can be a full path or a file that exists in your assets directory.
```ruby
favicon_link_tag
# => <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
```
#### image_path
Computes the path to an image asset in the `app/assets/images` directory. Full paths from the document root will be passed through. Used internally by `image_tag` to build the image path.
@ -152,6 +171,15 @@ stylesheet_url "application"
# => http://www.example.com/assets/application.css
```
#### video_tag
Generate an HTML video tag with source(s), either as a single tag for a string source or nested source tags within an array for multiple sources. The `sources` can be full paths, files in your public videos directory, or Active Storage attachments.
```ruby
video_tag("trailer")
# => <video src="/videos/trailer"></video>
```
### AtomFeedHelper
#### atom_feed