Skip to content

Commit 3ab0de8

Browse files
authored
Merge pull request rails#42560 from diegodauri/migrate-asset-pipeline-to-modern-js
Migrate asset pipeline to modern javascript
2 parents 935cf8d + 5883a3d commit 3ab0de8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

guides/source/asset_pipeline.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -407,18 +407,11 @@ If you add an `erb` extension to a JavaScript asset, making it something such as
407407
JavaScript code:
408408

409409
```js
410-
$('#logo').attr({ src: "<%= asset_path('logo.png') %>" });
410+
document.getElementById('logo').src = "<%= asset_path('logo.png') %>"
411411
```
412412

413413
This writes the path to the particular asset being referenced.
414414

415-
Similarly, you can use the `asset_path` helper in CoffeeScript files with `erb`
416-
extension (e.g., `application.coffee.erb`):
417-
418-
```js
419-
$('#logo').attr src: "<%= asset_path('logo.png') %>"
420-
```
421-
422415
### Manifest Files and Directives
423416

424417
Sprockets uses manifest files to determine which assets to include and serve.

0 commit comments

Comments
 (0)