3

I'm doing some work on a RoR application that gets deployed as a war file using warbler. Prior to my involvement, the few images in the app were in the asset pipeline, but my role is to introduce slippy maps and homegrown map tiles.

Because the tiles take up a lot of space, and because they won't change anywhere near as often as the app, the idea was to simply serve them from public/images/tiles. The war file for the rest of the app would be deployed, then the tiles would be untarred into the proper directory.

This works fine in development mode, but the warbler deployment uses a context path and the tiles get 404ed because they're found at /contextpath/images , not /images

I haven't worked in a jruby environment before and the rest of the team just so happens to be out on vacation this week (ha!). Nick Sieger's recommendation about using config.action_controller.asset_host at Warbler: Where are my images wrecks the images and css that do work via assets, so I'd be grateful for any other suggestions that allow assets and public to coexist.

Community
  • 1
  • 1
Eric Theise
  • 185
  • 8

1 Answers1

4

In production.rb try this line config.assets.precompile += %w( *.js *.scss *.coffee *.css ) then run jruby -S rake assets:precompile. It will compile all you assets to static assets and warbler will then package them accordingly, it should solve your problem.

Another thing you can check is how you are pointing to the images in the Views. if you want them to be found in /image you should write the path as <%= image_tag "\image" %>. Regard the trailing \.

mimsugara
  • 839
  • 11
  • 18