Skip to content

Commit

Permalink
Add example of configuring a custom asset finder class
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Feb 9, 2022
1 parent b7156ea commit c2ad743
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,20 @@ InlineSvg.configure do |config|
end
```

## Custom asset finder

Similarly, an asset finder class should have a `find_asset` class method, and
respond to a `pathname` instance method which returns the path to the file. If
no class is configured, a default static file class will be used.

A configuration example to use the Propshaft finder would look like:

```ruby
InlineSvg.configure do |config|
config.asset_finder = InlineSvg::PropshaftAssetFinder
end
```

## Caching all assets at boot time

When your deployment strategy prevents dynamic asset file loading from disk it
Expand Down

0 comments on commit c2ad743

Please sign in to comment.