Skip to content

Commit 21b72e4

Browse files
authored
Merge pull request rails#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]
2 parents e2833ad + cf605cd commit 21b72e4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

guides/source/action_view_helpers.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ image_tag("rails.png")
3333

3434
[`config.asset_host`]: configuring.html#config-asset-host
3535

36+
#### audio_tag
37+
38+
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.
39+
The `sources` can be full paths, files in your public audios directory, or Active Storage attachments.
40+
41+
```ruby
42+
audio_tag("sound")
43+
# => <audio src="/audios/sound"></audio>
44+
```
45+
3646
#### auto_discovery_link_tag
3747

3848
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
4252
# => <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed.rss" />
4353
```
4454

55+
#### favicon_link_tag
56+
57+
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.
58+
59+
```ruby
60+
favicon_link_tag
61+
# => <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
62+
```
63+
4564
#### image_path
4665

4766
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"
152171
# => http://www.example.com/assets/application.css
153172
```
154173

174+
#### video_tag
175+
176+
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.
177+
178+
```ruby
179+
video_tag("trailer")
180+
# => <video src="/videos/trailer"></video>
181+
```
182+
155183
### AtomFeedHelper
156184

157185
#### atom_feed

0 commit comments

Comments
 (0)