Skip to content

Commit d0eedcc

Browse files
Reword "Regarding the Rails Stack" section [ci-skip]
(cherry picked from commit 9418b34)
1 parent daced5b commit d0eedcc

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

guides/source/api_documentation_guidelines.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -358,29 +358,23 @@ user-facing API documentation.)
358358
Regarding the Rails Stack
359359
-------------------------
360360

361-
When documenting parts of Rails API, it's important to remember all of the
362-
pieces that go into the Rails stack.
361+
When documenting parts of Rails' API, it's important to be mindful of the entire
362+
Rails stack. Behavior of the method or class you're documenting may change
363+
depending on context.
363364

364-
This means that behavior may change depending on the scope or context of the
365-
method or class you're trying to document.
366-
367-
In various places there is different behavior when you take the entire stack
368-
into account, one such example is
369-
`ActionView::Helpers::AssetTagHelper#image_tag`:
365+
One such example is `ActionView::Helpers::AssetTagHelper#image_tag`:
370366

371367
```ruby
372368
# image_tag("icon.png")
373369
# # => <img src="/assets/icon.png" />
374370
```
375371

376-
Although the default behavior for `#image_tag` is to always return
377-
`/images/icon.png`, we take into account the full Rails stack (including the
378-
Asset Pipeline) we may see the result seen above.
379-
380-
We're only concerned with the behavior experienced when using the full default
381-
Rails stack.
372+
In isolation, `image_tag` would return `/images/icon.png`. However, when we take
373+
into account the full Rails stack, including the Asset Pipeline, we may see the
374+
above result.
382375

383-
In this case, we want to document the behavior of the _framework_, and not just
384-
this specific method.
376+
We want to document the behavior of the _framework_, not just isolated methods.
377+
Our concern is the behavior that the user experiences when using the full
378+
default Rails stack.
385379

386380
If you have a question on how the Rails team handles certain API, don't hesitate to open a ticket or send a patch to the [issue tracker](https://github.com/rails/rails/issues).

0 commit comments

Comments
 (0)