sstephenson/sprockets — Issue #222: Environment.path Removed, What should be used instead ?
Author: eMxyzptlk
Created: 2011-10-10 10:54:40+00:00
State: open

Hello,

This is more of a question than an issue, but I did not know where else to ask, I'm using Sinatra bundled in one of my Gems (work in progress) and with Sprokets 2.0.0 [I used to get the path of an asset using the following snippet](https://github.com/TechnoGate/watch_tower/blob/7e502cd5d3c449bb32099df2230a871d03fd063e/lib/watch_tower/server/helpers/asset.rb#L21):

```ruby
def asset_path(source)
settings.sprockets.path(source, true, "assets")
end
```

But in Sprockets 2.0.1 the path method (which was deprecated) c.f 00ca11e6943b5270d2f7bde94a4729927ce9ce6a So what should I use to get the asset path ?

I tried this

```ruby
def asset_path(source)
settings.sprockets.find_asset(source)
end
```

But instead of getting the path prefixed with "assets" like I used to (of course the prefix is not the issue because | can add it myself), I'm getting the contents of the asset instead..

Thanks!