title: How to serve image assets from an Engine in a Rails app
body: <p>I'm having trouble getting image assets in my engine to render inside the host app.</p>
  
  <p>My host app is capable of grabbing css and javascript from then engine thanks to code like this in the <code>view/layout/application.html.erb</code> file:</p>
  
  <pre><code> &lt;%= stylesheet_link_tag    'my_engine/application', :media =&gt; 'all' %&gt;
   &lt;%= javascript_include_tag 'my_engine/application' %&gt; 
  </code></pre>
  
  <p>However, I don't know of a similar method for including the images from my engine.  Any ideas on how I can get the engine's image files to render in the host app?</p>
  
  <p>Edit:</p>
  
  <p>In my engine's engine.rb file, I've added the images directory to the app's directory like this:</p>
  
  <pre><code>initializer :assets do |config|
    Rails.application.config.assets.paths &lt;&lt; root.join("app", "assets", "images", "my_engine", "some_subdirectory")
  end
  </code></pre>
  
  <p>and the view has an image tag that looks like this:</p>
  
  <pre><code>&lt;%= image_tag "/my_engine/some_subdirectory/picture.png" %&gt;
  </code></pre>
  
  <p>but my server logs, I see this:</p>
  
  <pre><code>Started GET "/assets/some_subdirectory/picture.png" for 127.0.0.1 at 2014-04-06 20:11:38 -0500
  Served asset /some_subdirectory/picture.png - 404 Not Found (3ms)
  
  ActionController::RoutingError (No route matches [GET] "/assets/some_subdirectory/picture.png"):
  </code></pre>