Skip to content

[ci skip] Correct docs for asset helpers #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@ in Sass):
#### `asset-path($relative-asset-path)`
Returns a string to the asset.

* `asset-path("rails.png")` becomes `"/assets/rails.png"`
* `asset-path("rails.png")` returns `"/assets/rails.png"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of this line is to tell that the call of asset-path("rails.png") will generate that string. So maybe we should change becomes with something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like is output as ? I suggested the change because I mis-understood "becomes" when I converted one of my rails projects to use the asset pipeline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe returns would be better for this case since we are talking about the method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, returns sounds good to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Could you update the patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did. Do you think I should also update this from my PR rails/rails#21143 for the Rails Asset Pipeline guide? Readers might be confused otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍. Please do.


#### `asset-url($relative-asset-path)`
Returns a url reference to the asset.

* `asset-url("rails.png")` becomes `url(/assets/rails.png)`
* `asset-url("rails.png")` returns `url(/assets/rails.png)`

As a convenience, for each of the following asset classes there are
corresponding `-path` and `-url` helpers:
image, font, video, audio, javascript, stylesheet.

* `image-path("rails.png")` becomes `"/assets/rails.png"`
* `image-url("rails.png")` becomes `url(/assets/rails.png)`
* `image-path("rails.png")` returns `"/assets/rails.png"`
* `image-url("rails.png")` returns `url(/assets/rails.png)`

#### `asset-data-url($relative-asset-path)`
Returns a url reference to the Base64-encoded asset at the specified path.

* `asset-data-url("rails.png")` becomes `url(data:image/png;base64,iVBORw0K...)`
* `asset-data-url("rails.png")` returns `url(data:image/png;base64,iVBORw0K...)`

## Running Tests

Expand Down