You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-auto_discovery_link_tag) for more information.
58
+
55
59
#### favicon_link_tag
56
60
57
61
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.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-favicon_link_tag) for more information.
69
+
64
70
#### image_path
65
71
66
72
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.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-image_path) for more information.
86
+
79
87
#### image_url
80
88
81
89
Computes the URL to an image asset in the `app/assets/images` directory. This will call `image_path` internally and merge with your current host or your asset host.
@@ -84,6 +92,8 @@ Computes the URL to an image asset in the `app/assets/images` directory. This wi
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag) for more information.
106
+
95
107
#### javascript_include_tag
96
108
97
109
Returns an HTML script tag for each of the sources provided. You can pass in the filename (`.js` extension is optional) of JavaScript files that exist in your `app/assets/javascripts` directory for inclusion into the current page or you can pass the full path relative to your document root.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-javascript_include_tag) for more information.
117
+
104
118
#### javascript_path
105
119
106
120
Computes the path to a JavaScript asset in the `app/assets/javascripts` directory. If the source filename has no extension, `.js` will be appended. Full paths from the document root will be passed through. Used internally by `javascript_include_tag` to build the script path.
@@ -109,6 +123,8 @@ Computes the path to a JavaScript asset in the `app/assets/javascripts` director
109
123
javascript_path "common"# => /assets/common.js
110
124
```
111
125
126
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-javascript_path) for more information.
127
+
112
128
#### javascript_url
113
129
114
130
Computes the URL to a JavaScript asset in the `app/assets/javascripts` directory. This will call `javascript_path` internally and merge with your current host or your asset host.
@@ -118,6 +134,8 @@ javascript_url "common"
118
134
# => http://www.example.com/assets/common.js
119
135
```
120
136
137
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-javascript_url) for more information.
138
+
121
139
#### picture_tag
122
140
123
141
Returns an HTML picture tag for the source. It supports passing a String, an Array or a Block.
@@ -136,6 +154,8 @@ This generates the following HTML:
136
154
</picture>
137
155
```
138
156
157
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-picture_tag) for more information.
158
+
139
159
#### preload_link_tag
140
160
141
161
Returns a link tag that browsers can use to preload the source. The source can be the path of a resource managed by asset pipeline, a full path, or an URI.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-preload_link_tag) for more information.
169
+
148
170
#### stylesheet_link_tag
149
171
150
172
Returns a stylesheet link tag for the sources specified as arguments. If you don't specify an extension, `.css` will be appended automatically.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-stylesheet_link_tag) for more information.
180
+
157
181
#### stylesheet_path
158
182
159
183
Computes the path to a stylesheet asset in the `app/assets/stylesheets` directory. If the source filename has no extension, `.css` will be appended. Full paths from the document root will be passed through. Used internally by `stylesheet_link_tag` to build the stylesheet path.
@@ -162,6 +186,8 @@ Computes the path to a stylesheet asset in the `app/assets/stylesheets` director
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-stylesheet_path) for more information.
190
+
165
191
#### stylesheet_url
166
192
167
193
Computes the URL to a stylesheet asset in the `app/assets/stylesheets` directory. This will call `stylesheet_path` internally and merge with your current host or your asset host.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-stylesheet_path) for more information.
201
+
174
202
#### video_tag
175
203
176
204
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.
@@ -180,6 +208,8 @@ video_tag("trailer")
180
208
# => <video src="/videos/trailer"></video>
181
209
```
182
210
211
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-video_tag) for more information.
212
+
183
213
### AtomFeedHelper
184
214
185
215
#### atom_feed
@@ -225,6 +255,8 @@ atom_feed do |feed|
225
255
end
226
256
```
227
257
258
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AtomFeedHelper.html#method-i-atom_feed) for more information.
259
+
228
260
### BenchmarkHelper
229
261
230
262
#### benchmark
@@ -239,6 +271,8 @@ Allows you to measure the execution time of a block in a template and records th
239
271
240
272
This would add something like "Process data files (0.34523)" to the log, which you can then use to compare timings when optimizing your code.
241
273
274
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html#method-i-benchmark) for more information.
275
+
242
276
### CacheHelper
243
277
244
278
#### cache
@@ -253,6 +287,8 @@ A method for caching fragments of a view rather than an entire action or page. T
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache) for more information.
291
+
256
292
### CaptureHelper
257
293
258
294
#### capture
@@ -278,6 +314,8 @@ The captured variable can then be used anywhere else.
278
314
</html>
279
315
```
280
316
317
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-capture) for more information.
318
+
281
319
#### content_for
282
320
283
321
Calling `content_for` stores a block of markup in an identifier for later use. You can make subsequent calls to the stored content in other templates or the layout by passing the identifier as an argument to `yield`.
@@ -308,6 +346,8 @@ For example, let's say we have a standard application layout, but also a special
308
346
<% end %>
309
347
```
310
348
349
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for) for more information.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words) for more information.
365
+
324
366
#### time_ago_in_words
325
367
326
368
Like `distance_of_time_in_words`, but where `to_time` is fixed to `Time.now`.
@@ -329,8 +371,12 @@ Like `distance_of_time_in_words`, but where `to_time` is fixed to `Time.now`.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-time_ago_in_words) for more information.
375
+
332
376
### DebugHelper
333
377
378
+
#### debug
379
+
334
380
Returns a `pre` tag that has object dumped by YAML. This creates a very readable way to inspect an object.
335
381
336
382
```ruby
@@ -349,6 +395,8 @@ third:
349
395
</pre>
350
396
```
351
397
398
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html#method-i-debug) for more information.
399
+
352
400
### FormHelper
353
401
354
402
Form helpers are designed to make working with models much easier compared to using just standard HTML elements by providing a set of methods for creating forms based on your models. This helper generates the HTML for forms, providing a method for each sort of input (e.g., text, password, select, and so on). When the form is submitted (i.e., when the user hits the submit button or form.submit is called via JavaScript), the form inputs will be bundled into the params object and passed back to the controller.
@@ -380,6 +428,8 @@ alert('All is good')
380
428
</script>
381
429
```
382
430
431
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-javascript_tag) for more information.
432
+
383
433
### NumberHelper
384
434
385
435
Provides methods for converting numbers into formatted strings. Methods are provided for phone numbers, currency, percentage, precision, positional notation, and file size.
@@ -392,6 +442,8 @@ Formats a number into a currency string (e.g., $13.65).
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_currency) for more information.
446
+
395
447
#### number_to_human
396
448
397
449
Pretty prints (formats and approximates) a number so it is more readable by users; useful for numbers that can get very large.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human_size) for more information.
468
+
413
469
#### number_to_percentage
414
470
415
471
Formats a number as a percentage string.
@@ -418,6 +474,8 @@ Formats a number as a percentage string.
418
474
number_to_percentage(100, precision:0) # => 100%
419
475
```
420
476
477
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_percentage) for more information.
478
+
421
479
#### number_to_phone
422
480
423
481
Formats a number into a phone number (US by default).
@@ -426,6 +484,8 @@ Formats a number into a phone number (US by default).
426
484
number_to_phone(1235551234) # => 123-555-1234
427
485
```
428
486
487
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_phone) for more information.
488
+
429
489
#### number_with_delimiter
430
490
431
491
Formats a number with grouped thousands using a delimiter.
@@ -434,6 +494,8 @@ Formats a number with grouped thousands using a delimiter.
434
494
number_with_delimiter(12345678) # => 12,345,678
435
495
```
436
496
497
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter) for more information.
498
+
437
499
#### number_with_precision
438
500
439
501
Formats a number with the specified level of `precision`, which defaults to 3.
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_precision) for more information.
509
+
446
510
### SanitizeHelper
447
511
448
512
The SanitizeHelper module provides a set of methods for scrubbing text of undesired HTML elements.
@@ -469,10 +533,14 @@ class Application < Rails::Application
469
533
end
470
534
```
471
535
536
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize) for more information.
537
+
472
538
#### sanitize_css(style)
473
539
474
540
Sanitizes a block of CSS code.
475
541
542
+
See the [API Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize_css) for more information.
543
+
476
544
#### strip_links(html)
477
545
478
546
Strips all link tags from text leaving just the link text.
0 commit comments