title: Get digested asset_path in model or controller
body: <p>I have an <code>Article</code> model, which has a field <code>svg_path</code>.</p>
  
  <p>I use <code>fabricjs</code> to draw a canvas that can contain multiple articles and is modifiable.</p>
  
  <p>What I do currently is generating a <code>json</code> that contains all needed fields of the articles, including the <code>svg_path</code>. </p>
  
  <p>When I try to use the <code>asset_path</code> helper (<a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_path" rel="noreferrer">http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html#method-i-asset_path</a>) in either my <code>Article</code> model or controller it will always just return the path without the digest, which works in development environment but not in production. There I include the helper like this:</p>
  
  <pre><code>include ActionView::Helpers::AssetUrlHelper
  
  asset_path(svg_path)
  </code></pre>
  
  <p>If I call this helper in the view it will generate the correct path including the digest hash.</p>
  
  <p>How can I get the correct path in my <code>json</code> objects?</p>