You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an asset isn't found the behavior is to pass the string through. For example a valid asset will return a url from pipeline
```
asset_path("application.js")
# => assets/application-123098udasvi0mnafd.js
```
While if you make a typo, you won't get an error or anything, it just falls through:
```
asset_path("app1icati0n.js")
# => "app1icati0n.js"
```
Hopefully I don't have to elaborate on why this is bad.
This PR is a child PR to one in Rails that will introduce a `public_asset_path` API.
There are valid reasons for not using the asset pipeline, if you have a purely static asset in the public folder or if you want to link to a static URL in your assets somewhere it makes sense to declare that intention. Eventually we will replace the behavior of the deprecation with an exception so people don't lose hours of their to typos.
We only emit the deprecation when a `public_` api is available in Rails. This means that sprockets-rails can still be used in a backwards compatible manner.
0 commit comments