Skip to content

Commit 3ae8d7b

Browse files
committed
Replace "here" link titles with meaningful titles
For accessibility reasons[1], it's recommended not to use "here"/"click here"/"more" as the title for a link. When screen reader users are tabbing through all links on the page, they'll miss the context of "read more about X" preceding the "here". Thankfully, the sentences in the are largely good to go, so the "here" can be dropped in favour of the last part of the sentence to give the link title more meaning. Some of these text changes may seem trivial, but when considering the link text outwith its context sentences, the text has some more meaning for those reading them through screen readers. (e.g. "API documentation" -> "`number_to_currency` API documentation") [1]: https://www.gov.uk/guidance/content-design/links#writing-link-text
1 parent d43ee20 commit 3ae8d7b

7 files changed

+91
-85
lines changed

guides/source/action_text_overview.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Action Text includes a [WYSIWYG](https://en.wikipedia.org/wiki/WYSIWYG) editor
2727
called Trix, which is used in web applications to provide users with a
2828
user-friendly interface for creating and editing rich text content. It handles
2929
everything from providing enriching capabilities like the formatting of text,
30-
adding links or quotes, embedding images, and much much more. You can view an
31-
example of the Trix editor [here](https://trix-editor.org/).
30+
adding links or quotes, embedding images, and much much more. See [the Trix
31+
editor website](https://trix-editor.org/) for examples.
3232

3333
The rich text content generated by the Trix editor is saved in its own RichText
3434
model that can be associated with any existing Active Record model in the
@@ -183,9 +183,8 @@ content as follows:
183183
`ActionText::RichText#to_s` safely transforms RichText into an HTML String. On
184184
the other hand `ActionText::RichText#to_plain_text` returns a string that is not
185185
HTML safe and should not be rendered in browsers. You can learn more about
186-
Action Text's sanitization process in the
187-
[documentation](https://api.rubyonrails.org/classes/ActionText/RichText.html)
188-
for the `ActionText::RichText` class.
186+
Action Text's sanitization process in the [`ActionText::RichText`
187+
documentation](https://api.rubyonrails.org/classes/ActionText/RichText.html).
189188

190189
NOTE: If there's an attached resource within `content` field, it might not show
191190
properly unless you have the necessary [dependencies for Active
@@ -261,7 +260,7 @@ Storage as well as attachments that are linked to a Signed GlobalID.
261260
### Active Storage
262261

263262
When uploading an image within your rich text editor, it uses Action Text which
264-
in turn uses Active Storage. However, Active Storage has [some
263+
in turn uses Active Storage. However, [Active Storage has some
265264
dependencies](active_storage_overview.html#requirements) which are not provided
266265
by Rails. To use the built-in previewers, you must install these libraries.
267266

guides/source/action_view_helpers.md

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ NOTE: We use `Time.current` instead of `Time.now` because it returns the current
4343
time based on the timezone set in Rails, whereas `Time.now` returns a Time
4444
object based on the server's timezone.
4545

46-
See the [API
46+
See the [`distance_of_time_in_words` API
4747
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words)
4848
for more information.
4949

@@ -56,7 +56,7 @@ integer as seconds, and `Time.current`.
5656
time_ago_in_words(3.minutes.from_now) # => 3 minutes
5757
```
5858

59-
See the [API
59+
See the [`time_ago_in_words` API
6060
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-time_ago_in_words)
6161
for more information.
6262

@@ -74,7 +74,7 @@ Formats a number into a currency string (e.g., $13.65).
7474
number_to_currency(1234567890.50) # => $1,234,567,890.50
7575
```
7676

77-
See the [API
77+
See the [`number_to_currency` API
7878
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_currency)
7979
for more information.
8080

@@ -88,7 +88,7 @@ number_to_human(1234) # => 1.23 Thousand
8888
number_to_human(1234567) # => 1.23 Million
8989
```
9090

91-
See the [API
91+
See the [`number_to_human` API
9292
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human)
9393
for more information.
9494

@@ -102,7 +102,7 @@ number_to_human_size(1234) # => 1.21 KB
102102
number_to_human_size(1234567) # => 1.18 MB
103103
```
104104

105-
See the [API
105+
See the [`number_to_human_size` API
106106
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_human_size)
107107
for more information.
108108

@@ -114,7 +114,7 @@ Formats a number as a percentage string.
114114
number_to_percentage(100, precision: 0) # => 100%
115115
```
116116

117-
See the [API
117+
See the [`number_to_percentage` API
118118
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_percentage)
119119
for more information.
120120

@@ -126,7 +126,7 @@ Formats a number into a phone number (US by default).
126126
number_to_phone(1235551234) # => 123-555-1234
127127
```
128128

129-
See the [API
129+
See the [`number_to_phone` API
130130
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_to_phone)
131131
for more information.
132132

@@ -138,7 +138,7 @@ Formats a number with grouped thousands using a delimiter.
138138
number_with_delimiter(12345678) # => 12,345,678
139139
```
140140

141-
See the [API
141+
See the [`number_with_delimiter` API
142142
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_delimiter)
143143
for more information.
144144

@@ -151,7 +151,7 @@ number_with_precision(111.2345) # => 111.235
151151
number_with_precision(111.2345, precision: 2) # => 111.23
152152
```
153153

154-
See the [API
154+
See the [`number_with_precision` API
155155
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_precision)
156156
for more information.
157157

@@ -174,7 +174,7 @@ excerpt("This is also an example", "an", radius: 8, omission: "<chop> ")
174174
#=> <chop> is also an example
175175
```
176176

177-
See the [API
177+
See the [`excerpt` API
178178
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-excerpt)
179179
for more information.
180180

@@ -188,7 +188,7 @@ pluralize(2, "person") # => 2 people
188188
pluralize(3, "person", plural: "users") # => 3 users
189189
```
190190

191-
See the [API
191+
See the [`pluralize` API
192192
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-pluralize)
193193
for more information.
194194

@@ -215,7 +215,7 @@ truncate("<p>Once upon a time in a world far far away</p>", escape: false)
215215
# => "<p>Once upon a time in a wo..."
216216
```
217217

218-
See the [API
218+
See the [`truncate` API
219219
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-truncate)
220220
for more information.
221221

@@ -228,7 +228,7 @@ word_wrap("Once upon a time", line_width: 8)
228228
# => "Once\nupon a\ntime"
229229
```
230230

231-
See the [API
231+
See the [`word_wrap` API
232232
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#method-i-word_wrap)
233233
for more information.
234234

@@ -267,7 +267,7 @@ would output the following HTML:
267267
</form>
268268
```
269269

270-
See the [API
270+
See the [`button_to` API
271271
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-button_to)
272272
for more information.
273273

@@ -281,7 +281,7 @@ Returns true if the current request URL matches the given `options`.
281281
<% end %>
282282
```
283283

284-
See the [API
284+
See the [`current_page?` API
285285
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-current_page-3F)
286286
for more information.
287287

@@ -324,7 +324,7 @@ It would output the following HTML:
324324
</a>
325325
```
326326

327-
See the [API
327+
See the [`link_to` API
328328
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to)
329329
for more information.
330330

@@ -343,7 +343,7 @@ mail_to "me@john_doe.com", cc: "me@jane_doe.com",
343343
# => <a href="mailto:"me@john_doe.com?cc=me@jane_doe.com&subject=This%20is%20an%20example%20email">"me@john_doe.com</a>
344344
```
345345

346-
See the [API
346+
See the [`mail_to` API
347347
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-mail_to)
348348
for more information.
349349

@@ -399,7 +399,7 @@ class Application < Rails::Application
399399
end
400400
```
401401

402-
See the [API
402+
See the [`sanitize` API
403403
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize)
404404
for more information.
405405

@@ -415,7 +415,7 @@ The `sanitize_css` method below will remove the styles that are not allowed.
415415
sanitize_css("background-color: red; color: white; font-size: 16px;")
416416
```
417417

418-
See the [API
418+
See the [`sanitize_css` API
419419
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize_css)
420420
for more information.
421421

@@ -434,7 +434,7 @@ strip_links("Blog: <a href='http://myblog.com/'>Visit</a>.")
434434
# => Blog: Visit.
435435
```
436436

437-
See the [API
437+
See the [`strip_links` API
438438
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_links)
439439
for more information.
440440

@@ -453,7 +453,7 @@ strip_links('<<a href="https://example.org">malformed & link</a>')
453453
# => &lt;malformed &amp; link
454454
```
455455

456-
See the [API
456+
See the [`strip_tags` API
457457
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags)
458458
for more information.
459459

@@ -505,7 +505,7 @@ INFO: Internally, `audio_tag` uses [`audio_path` from the
505505
AssetUrlHelpers](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-audio_path)
506506
to build the audio path.
507507

508-
See the [API
508+
See the [`audio_tag` API
509509
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-audio_tag)
510510
for more information.
511511

@@ -519,7 +519,7 @@ auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", { title: "RSS F
519519
# => <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="http://www.example.com/feed.rss" />
520520
```
521521

522-
See the [API
522+
See the [`auto_discovery_link_tag` API
523523
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-auto_discovery_link_tag)
524524
for more information.
525525

@@ -533,7 +533,7 @@ favicon_link_tag
533533
# => <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
534534
```
535535

536-
See the [API
536+
See the [`favicon_link_tag` API
537537
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-favicon_link_tag)
538538
for more information.
539539

@@ -554,7 +554,7 @@ INFO: Internally, `image_tag` uses [`image_path` from the
554554
AssetUrlHelpers](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-image_path)
555555
to build the image path.
556556

557-
See the [API
557+
See the [`image_tag` API
558558
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag)
559559
for more information.
560560

@@ -582,7 +582,7 @@ INFO: Internally, `javascript_include_tag` uses [`javascript_path` from the
582582
AssetUrlHelpers](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-javascript_path)
583583
to build the script path.
584584

585-
See the [API
585+
See the [`javascript_include_tag` API
586586
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-javascript_include_tag)
587587
for more information.
588588

@@ -605,7 +605,7 @@ This generates the following HTML:
605605
</picture>
606606
```
607607

608-
See the [API
608+
See the [`picture_tag` API
609609
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-picture_tag)
610610
for more information.
611611

@@ -619,7 +619,7 @@ preload_link_tag("application.css")
619619
# => <link rel="preload" href="/assets/application.css" as="style" type="text/css" />
620620
```
621621

622-
See the [API
622+
See the [`preload_link_tag` API
623623
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-preload_link_tag)
624624
for more information.
625625

@@ -643,7 +643,7 @@ INFO: Internally, `stylesheet_link_tag` uses [`stylesheet_path` from the
643643
AssetUrlHelpers](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-stylesheet_path)
644644
to build the stylesheet path.
645645

646-
See the [API
646+
See the [`stylesheet_link_tag` API
647647
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-stylesheet_link_tag)
648648
for more information.
649649

@@ -669,7 +669,7 @@ INFO: Internally, `video_tag` uses [`video_path` from the
669669
AssetUrlHelpers](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-video_path)
670670
to build the video path.
671671

672-
See the [API
672+
See the [`video_tag` API
673673
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-video_tag)
674674
for more information.
675675

@@ -701,7 +701,7 @@ My name is <%= current_user.name %>, and I'm here to say "Welcome to our website
701701

702702
This will escape the quotes correctly and display the greeting in an alert box.
703703

704-
See the [API
704+
See the [`escape_javascript` API
705705
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-escape_javascript)
706706
for more information.
707707

@@ -730,7 +730,7 @@ Instead of passing the content as an argument, you can also use a block.
730730
<% end %>
731731
```
732732

733-
See the [API
733+
See the [`javascript_tag` API
734734
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/JavaScriptHelper.html#method-i-javascript_tag)
735735
for more information.
736736

@@ -778,7 +778,7 @@ tag.div data: { user_id: 123 }
778778
# => <div data-user-id="123"></div>
779779
```
780780

781-
See the [API
781+
See the [`tag` API
782782
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-tag)
783783
for more information.
784784

@@ -840,7 +840,7 @@ The return of capture is the string generated by the block.
840840
# => "Welcome to my shiny new web page! The date and time is 2018-09-06 11:09:16 -0500"
841841
```
842842

843-
See the [API
843+
See the [`capture` API
844844
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-capture)
845845
for more information.
846846

@@ -905,7 +905,7 @@ a specific identifier in the order they are provided. Each subsequent call
905905
simply adds to what's already stored. In contrast, `capture` only returns the
906906
content of the block, without keeping track of any previous invocations.
907907

908-
See the [API
908+
See the [`content_for` API
909909
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#method-i-content_for)
910910
for more information.
911911

@@ -930,7 +930,7 @@ you can then use to compare timings when optimizing your code.
930930
NOTE: This helper is a part of Active Support, and it is also available on
931931
controllers, helpers, models, etc.
932932

933-
See the [API
933+
See the [`benchmark` API
934934
Documentation](https://api.rubyonrails.org/classes/ActiveSupport/Benchmarkable.html#method-i-benchmark)
935935
for more information.
936936

@@ -971,7 +971,8 @@ a new cache entry with a unique key. A key looks something like this:
971971
views/articles/index:bea67108094918eeba32cd4a6f786301/articles/1
972972
```
973973

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
975976
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/CacheHelper.html#method-i-cache)
976977
for more information.
977978

@@ -1023,7 +1024,7 @@ atom_feed do |feed|
10231024
end
10241025
```
10251026

1026-
See the [API
1027+
See the [`atom_feed` API
10271028
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/AtomFeedHelper.html#method-i-atom_feed)
10281029
for more information.
10291030

@@ -1048,6 +1049,6 @@ third:
10481049
</pre>
10491050
```
10501051

1051-
See the [API
1052+
See the [`debug` API
10521053
Documentation](https://api.rubyonrails.org/classes/ActionView/Helpers/DebugHelper.html#method-i-debug)
10531054
for more information.

guides/source/action_view_overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,5 +856,5 @@ directory. For example, setting `I18n.locale = :de` and creating
856856
`public/500.de.html` and `public/404.de.html` would allow you to have localized
857857
rescue pages.
858858

859-
You can read more about the Rails Internationalization (I18n) API
860-
[here](i18n.html).
859+
See the [Rails Internationalization (I18n) API documentation](i18n.html) for
860+
more details.

0 commit comments

Comments
 (0)