assets%d.domain.com

Stupid question time:

I've recently moved our site to Rails 2.0 and am trying to get the
asset host functionality working. I followed the docs and added this
line to production.rb:

config.action_controller.asset_host='http://asset%d.moomai.com'

However, when I run the code on our production server, the asset links
actually get printed thusly:

<img src="http://asset%d.moomain.com/images/logo.gif" />

I'm pretty sure it's supposed to have an integer in there in place of
the "%d" but it doesn't seem to be parsing it properly. I tried with
single- and double-quotes, but no dice.

Any ideas?

:luis

Give just the host name:
  config.action_controller.asset_host = 'asset%d.moomai.com'

jeremy

Hmm, now the links are becoming: <link href="asset%d.moomai.com/
stylesheets/base_3667.css" media="screen" rel="Stylesheet" type="text/
css" /> ... pretty sure that's not how it's supposed to work. Any
thing else I can try?

Hopefully this will help others out there who may have run into the
same problems as I have. When I was reading Peepcode's Rails 2.0
Primer, his discussion regarding asset_hosts led me to believe that
you could use ...

config.action_controller.asset_host = "asset%d.moomai.com"

... in conjunction with the asset-packager plugin (which required a
small patch to get working, but that was alright). However, it turns
out that the two don't mix, as you can see from the problem I've been
having in my previous messages.

Once I removed asset-packager and replaced the handful of methods that
it provided, the built-in asset_hosts worked perfectly. I don't
pretend to understand why these two couldn't work together (surely the
host name can be separately resolved from the rest of the resource
URL?), but hopefully this information will help someone else out
there.

cheers

:luis