title: Images stopped loading on heroku
body: <p>My Heroku app uses an image uploader for attaching images to a form. The images were saving and displaying on the page just fine, but then all of the sudden they won't load. </p>
  
  <p>Sometimes the console says this:</p>
  
  <pre><code>Failed to load resource: the server responded with a status of 404 (Not Found)
  </code></pre>
  
  <p>And sometimes it says this:</p>
  
  <pre><code>GET https://safe-inlet-93558.herokuapp.com/uploads/grant/image/9/banner_banner_DSC_00134272684.jpg 404 (Not Found)
  </code></pre>
  
  <p>The heroku log says this:</p>
  
  <pre><code>ActionController::RoutingError (No route matches [GET] "/uploads/grant/image/10/robot9324566.jpg"
  </code></pre>
  
  <p>Here is my production.rb file:</p>
  
  <pre><code>config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?  
  config.assets.compile = false
  </code></pre>
  
  <p>I have tried setting config.assets.compile to true, and config.serve_static_assets to true, but it made no difference.</p>