1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Copy edits from e0f3f1a [ci skip]

- image_tag is an instance method
- explain possible results when asset pipeline is used
This commit is contained in:
Zachary Scott 2014-06-13 11:38:02 -07:00
parent 1a203d5e07
commit cc255d3424

View file

@ -341,15 +341,19 @@ method or class you're trying to document.
In various places there is different behavior when you take the entire stack In various places there is different behavior when you take the entire stack
into account, one such example is into account, one such example is
`ActionView::Helpers::AssetTagHelper.image_tag`: `ActionView::Helpers::AssetTagHelper#image_tag`:
```ruby ```ruby
# image_tag("icon.png") # image_tag("icon.png")
# # => <img alt="Icon" src="/assets/icon.png" /> # # => <img alt="Icon" src="/assets/icon.png" />
``` ```
Although the default behavior for `image_tag` is `/images/icon.png`, because Although the default behavior for `#image_tag` is to always return
the Rails stack includes Sprockets when using the Rails Asset Pipeline. `/images/icon.png`, we take into account the full Rails stack (including the
Asset Pipeline) we may see the result seen above.
We're only concerned with the behavior experienced when using the full default
Rails stack.
In this case, we want to document the behavior of the _framework_, and not just In this case, we want to document the behavior of the _framework_, and not just
this specific method. this specific method.