@@ -43,7 +43,7 @@ NOTE: We use `Time.current` instead of `Time.now` because it returns the current
43
43
time based on the timezone set in Rails, whereas ` Time.now ` returns a Time
44
44
object based on the server's timezone.
45
45
46
- See the [ API
46
+ See the [ ` distance_of_time_in_words ` API
47
47
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words )
48
48
for more information.
49
49
@@ -56,7 +56,7 @@ integer as seconds, and `Time.current`.
56
56
time_ago_in_words(3 .minutes.from_now) # => 3 minutes
57
57
```
58
58
59
- See the [ API
59
+ See the [ ` time_ago_in_words ` API
60
60
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-time_ago_in_words )
61
61
for more information.
62
62
@@ -74,7 +74,7 @@ Formats a number into a currency string (e.g., $13.65).
74
74
number_to_currency(1234567890.50 ) # => $1,234,567,890.50
75
75
```
76
76
77
- See the [ API
77
+ See the [ ` number_to_currency ` API
78
78
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_currency )
79
79
for more information.
80
80
@@ -88,7 +88,7 @@ number_to_human(1234) # => 1.23 Thousand
88
88
number_to_human(1234567 ) # => 1.23 Million
89
89
```
90
90
91
- See the [ API
91
+ See the [ ` number_to_human ` API
92
92
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human )
93
93
for more information.
94
94
@@ -102,7 +102,7 @@ number_to_human_size(1234) # => 1.21 KB
102
102
number_to_human_size(1234567 ) # => 1.18 MB
103
103
```
104
104
105
- See the [ API
105
+ See the [ ` number_to_human_size ` API
106
106
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human_size )
107
107
for more information.
108
108
@@ -114,7 +114,7 @@ Formats a number as a percentage string.
114
114
number_to_percentage(100 , precision: 0 ) # => 100%
115
115
```
116
116
117
- See the [ API
117
+ See the [ ` number_to_percentage ` API
118
118
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_percentage )
119
119
for more information.
120
120
@@ -126,7 +126,7 @@ Formats a number into a phone number (US by default).
126
126
number_to_phone(1235551234 ) # => 123-555-1234
127
127
```
128
128
129
- See the [ API
129
+ See the [ ` number_to_phone ` API
130
130
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_phone )
131
131
for more information.
132
132
@@ -138,7 +138,7 @@ Formats a number with grouped thousands using a delimiter.
138
138
number_with_delimiter(12345678 ) # => 12,345,678
139
139
```
140
140
141
- See the [ API
141
+ See the [ ` number_with_delimiter ` API
142
142
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter )
143
143
for more information.
144
144
@@ -151,7 +151,7 @@ number_with_precision(111.2345) # => 111.235
151
151
number_with_precision(111.2345 , precision: 2 ) # => 111.23
152
152
```
153
153
154
- See the [ API
154
+ See the [ ` number_with_precision ` API
155
155
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_precision )
156
156
for more information.
157
157
@@ -174,7 +174,7 @@ excerpt("This is also an example", "an", radius: 8, omission: "<chop> ")
174
174
# => <chop> is also an example
175
175
```
176
176
177
- See the [ API
177
+ See the [ ` excerpt ` API
178
178
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-excerpt )
179
179
for more information.
180
180
@@ -188,7 +188,7 @@ pluralize(2, "person") # => 2 people
188
188
pluralize(3 , " person" , plural: " users" ) # => 3 users
189
189
```
190
190
191
- See the [ API
191
+ See the [ ` pluralize ` API
192
192
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-pluralize )
193
193
for more information.
194
194
@@ -215,7 +215,7 @@ truncate("<p>Once upon a time in a world far far away</p>", escape: false)
215
215
# => "<p>Once upon a time in a wo..."
216
216
```
217
217
218
- See the [ API
218
+ See the [ ` truncate ` API
219
219
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate )
220
220
for more information.
221
221
@@ -228,7 +228,7 @@ word_wrap("Once upon a time", line_width: 8)
228
228
# => "Once\nupon a\ntime"
229
229
```
230
230
231
- See the [ API
231
+ See the [ ` word_wrap ` API
232
232
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-word_wrap )
233
233
for more information.
234
234
@@ -267,7 +267,7 @@ would output the following HTML:
267
267
</form >
268
268
```
269
269
270
- See the [ API
270
+ See the [ ` button_to ` API
271
271
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to )
272
272
for more information.
273
273
@@ -281,7 +281,7 @@ Returns true if the current request URL matches the given `options`.
281
281
<% end %>
282
282
```
283
283
284
- See the [ API
284
+ See the [ ` current_page? ` API
285
285
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-current_page-3F )
286
286
for more information.
287
287
@@ -324,7 +324,7 @@ It would output the following HTML:
324
324
</a >
325
325
```
326
326
327
- See the [ API
327
+ See the [ ` link_to ` API
328
328
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to )
329
329
for more information.
330
330
@@ -343,7 +343,7 @@ mail_to "me@john_doe.com", cc: "me@jane_doe.com",
343
343
# => <a href="mailto:"me@john_doe.com?cc=me@jane_doe.com&subject=This%20is%20an%20example%20email">"me@john_doe.com</a>
344
344
```
345
345
346
- See the [ API
346
+ See the [ ` mail_to ` API
347
347
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-mail_to )
348
348
for more information.
349
349
@@ -399,7 +399,7 @@ class Application < Rails::Application
399
399
end
400
400
```
401
401
402
- See the [ API
402
+ See the [ ` sanitize ` API
403
403
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize )
404
404
for more information.
405
405
@@ -415,7 +415,7 @@ The `sanitize_css` method below will remove the styles that are not allowed.
415
415
sanitize_css(" background-color: red; color: white; font-size: 16px;" )
416
416
```
417
417
418
- See the [ API
418
+ See the [ ` sanitize_css ` API
419
419
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize_css )
420
420
for more information.
421
421
@@ -434,7 +434,7 @@ strip_links("Blog: <a href='http://myblog.com/'>Visit</a>.")
434
434
# => Blog: Visit.
435
435
```
436
436
437
- See the [ API
437
+ See the [ ` strip_links ` API
438
438
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_links )
439
439
for more information.
440
440
@@ -453,7 +453,7 @@ strip_links('<<a href="https://example.org">malformed & link</a>')
453
453
# => <malformed & link
454
454
```
455
455
456
- See the [ API
456
+ See the [ ` strip_tags ` API
457
457
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags )
458
458
for more information.
459
459
@@ -505,7 +505,7 @@ INFO: Internally, `audio_tag` uses [`audio_path` from the
505
505
AssetUrlHelpers] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-audio_path )
506
506
to build the audio path.
507
507
508
- See the [ API
508
+ See the [ ` audio_tag ` API
509
509
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-audio_tag )
510
510
for more information.
511
511
@@ -519,7 +519,7 @@ auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", { title: "RSS F
519
519
# => <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed.rss" />
520
520
```
521
521
522
- See the [ API
522
+ See the [ ` auto_discovery_link_tag ` API
523
523
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-auto_discovery_link_tag )
524
524
for more information.
525
525
@@ -533,7 +533,7 @@ favicon_link_tag
533
533
# => <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
534
534
```
535
535
536
- See the [ API
536
+ See the [ ` favicon_link_tag ` API
537
537
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-favicon_link_tag )
538
538
for more information.
539
539
@@ -554,7 +554,7 @@ INFO: Internally, `image_tag` uses [`image_path` from the
554
554
AssetUrlHelpers] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-image_path )
555
555
to build the image path.
556
556
557
- See the [ API
557
+ See the [ ` image_tag ` API
558
558
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag )
559
559
for more information.
560
560
@@ -582,7 +582,7 @@ INFO: Internally, `javascript_include_tag` uses [`javascript_path` from the
582
582
AssetUrlHelpers] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-javascript_path )
583
583
to build the script path.
584
584
585
- See the [ API
585
+ See the [ ` javascript_include_tag ` API
586
586
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-javascript_include_tag )
587
587
for more information.
588
588
@@ -605,7 +605,7 @@ This generates the following HTML:
605
605
</picture >
606
606
```
607
607
608
- See the [ API
608
+ See the [ ` picture_tag ` API
609
609
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-picture_tag )
610
610
for more information.
611
611
@@ -619,7 +619,7 @@ preload_link_tag("application.css")
619
619
# => <link rel="preload" href="/assets/application.css" as="style" type="text/css" />
620
620
```
621
621
622
- See the [ API
622
+ See the [ ` preload_link_tag ` API
623
623
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-preload_link_tag )
624
624
for more information.
625
625
@@ -643,7 +643,7 @@ INFO: Internally, `stylesheet_link_tag` uses [`stylesheet_path` from the
643
643
AssetUrlHelpers] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-stylesheet_path )
644
644
to build the stylesheet path.
645
645
646
- See the [ API
646
+ See the [ ` stylesheet_link_tag ` API
647
647
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-stylesheet_link_tag )
648
648
for more information.
649
649
@@ -669,7 +669,7 @@ INFO: Internally, `video_tag` uses [`video_path` from the
669
669
AssetUrlHelpers] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-video_path )
670
670
to build the video path.
671
671
672
- See the [ API
672
+ See the [ ` video_tag ` API
673
673
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-video_tag )
674
674
for more information.
675
675
@@ -701,7 +701,7 @@ My name is <%= current_user.name %>, and I'm here to say "Welcome to our website
701
701
702
702
This will escape the quotes correctly and display the greeting in an alert box.
703
703
704
- See the [ API
704
+ See the [ ` escape_javascript ` API
705
705
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-escape_javascript )
706
706
for more information.
707
707
@@ -730,7 +730,7 @@ Instead of passing the content as an argument, you can also use a block.
730
730
<% end %>
731
731
```
732
732
733
- See the [ API
733
+ See the [ ` javascript_tag ` API
734
734
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-javascript_tag )
735
735
for more information.
736
736
@@ -778,7 +778,7 @@ tag.div data: { user_id: 123 }
778
778
# => <div data-user-id="123"></div>
779
779
```
780
780
781
- See the [ API
781
+ See the [ ` tag ` API
782
782
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag )
783
783
for more information.
784
784
@@ -840,7 +840,7 @@ The return of capture is the string generated by the block.
840
840
# => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500"
841
841
```
842
842
843
- See the [ API
843
+ See the [ ` capture ` API
844
844
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-capture )
845
845
for more information.
846
846
@@ -905,7 +905,7 @@ a specific identifier in the order they are provided. Each subsequent call
905
905
simply adds to what's already stored. In contrast, ` capture ` only returns the
906
906
content of the block, without keeping track of any previous invocations.
907
907
908
- See the [ API
908
+ See the [ ` content_for ` API
909
909
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for )
910
910
for more information.
911
911
@@ -930,7 +930,7 @@ you can then use to compare timings when optimizing your code.
930
930
NOTE: This helper is a part of Active Support, and it is also available on
931
931
controllers, helpers, models, etc.
932
932
933
- See the [ API
933
+ See the [ ` benchmark ` API
934
934
Documentation] ( https://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html#method-i-benchmark )
935
935
for more information.
936
936
@@ -971,7 +971,8 @@ a new cache entry with a unique key. A key looks something like this:
971
971
views/articles/index:bea67108094918eeba32cd4a6f786301/articles/1
972
972
```
973
973
974
- See [ ` Fragment Caching ` ] ( caching_with_rails.html#fragment-caching ) and the [ API
974
+ See [ ` Fragment Caching ` ] ( caching_with_rails.html#fragment-caching ) and the
975
+ [ ` cache ` API
975
976
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache )
976
977
for more information.
977
978
@@ -1023,7 +1024,7 @@ atom_feed do |feed|
1023
1024
end
1024
1025
```
1025
1026
1026
- See the [ API
1027
+ See the [ ` atom_feed ` API
1027
1028
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/AtomFeedHelper.html#method-i-atom_feed )
1028
1029
for more information.
1029
1030
@@ -1048,6 +1049,6 @@ third:
1048
1049
</pre >
1049
1050
```
1050
1051
1051
- See the [ API
1052
+ See the [ ` debug ` API
1052
1053
Documentation] ( https://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html#method-i-debug )
1053
1054
for more information.
0 commit comments