Skip to content

Commit 9418b34

Browse files
Reword "Regarding the Rails Stack" section [ci-skip]
1 parent ce019f1 commit 9418b34

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
@@ -401,29 +401,23 @@ user-facing API documentation.)
401401
Regarding the Rails Stack
402402
-------------------------
403403

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

407-
This means that behavior may change depending on the scope or context of the
408-
method or class you're trying to document.
409-
410-
In various places there is different behavior when you take the entire stack
411-
into account, one such example is
412-
`ActionView::Helpers::AssetTagHelper#image_tag`:
408+
One such example is `ActionView::Helpers::AssetTagHelper#image_tag`:
413409

414410
```ruby
415411
# image_tag("icon.png")
416412
# # => <img src="/assets/icon.png" />
417413
```
418414

419-
Although the default behavior for `#image_tag` is to always return
420-
`/images/icon.png`, we take into account the full Rails stack (including the
421-
Asset Pipeline) we may see the result seen above.
422-
423-
We're only concerned with the behavior experienced when using the full default
424-
Rails stack.
415+
In isolation, `image_tag` would return `/images/icon.png`. However, when we take
416+
into account the full Rails stack, including the Asset Pipeline, we may see the
417+
above result.
425418

426-
In this case, we want to document the behavior of the _framework_, and not just
427-
this specific method.
419+
We want to document the behavior of the _framework_, not just isolated methods.
420+
Our concern is the behavior that the user experiences when using the full
421+
default Rails stack.
428422

429423
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)