title: Rails: Create og:image with asset pipeline hash URL
body: <p>Because I am facing issues with Hootsuite retrieving images stores on Amazon S3, I want to add a "fallback" image via the og:image tag. (Let's ignore the S3 issue here, that's for another day.)
  The image is stored locally on my Heroku and in Articles that have no image specified otherwise, I successfully use it as follows:</p>
  
  <pre><code>&lt;%= image_tag "fallback/my-fallback-image.jpg" %&gt;
  </code></pre>
  
  <p>For some reason though, Hootsuite's algorithm is still too dumb for that, hence I want to add the <code>og:image</code>.</p>
  
  <p>The application layout retrieves the tag like so:</p>
  
  <pre><code>&lt;%= yield :og_image %&gt;
  </code></pre>
  
  <p>I have added a helper like so:</p>
  
  <pre><code>def og_image(url)
      content_for(:og_image, tag(:meta, :property =&gt; "og:image", :content =&gt; url)) if url
  end
  </code></pre>
  
  <p>In the view, I add the image like so:</p>
  
  <pre><code>&lt;%= provide(:og_image, og_image(image_url("/fallback/my-fallback-image.jpg"))) %&gt;
  </code></pre>
  
  <p>In production, while <code>image_tag</code> (as shown above) works fine and includes a hash, the <code>og:image</code> tag ends up like this:</p>
  
  <pre><code>&lt;meta property="og:image" content="http://www.example.com/images/%2Ffallback%2Fmy-fallback-image.jpg" /&gt;
  </code></pre>
  
  <p>So not only does it mess up the slashes, it also forgets the hash.</p>
  
  <p>I'm somewhat restricted by using Heroku and want to stick with the asset pipeline. How should I do this?</p>
  
  <p>Thanks!</p>