# Assets%d.domain.com

**URL:** <https://www.ruby-forum.com/t/assets-d-domain-com/123490>\
**Category:** Rails\
**Created:** [December 18, 2007, 6:17am UTC](https://www.ruby-forum.com/t/assets-d-domain-com/123490 "2007-12-18T06:17:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 18, 2007, 6:17am UTC](https://www.ruby-forum.com/t/assets-d-domain-com/123490/1 "2007-12-18T06:17:14Z")

</div>

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](http://asset)%[d.moomai.com](http://d.moomai.com)’

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

![](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

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 18, 2007, 8:33am UTC](https://www.ruby-forum.com/t/assets-d-domain-com/123490/2 "2007-12-18T08:33:31Z")

</div>

On 12/17/07, luis, syndeomedia [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> actually get printed thusly:
> 
> ![](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?

Give just the host name:  
config.action\_controller.asset\_host = ‘asset%[d.moomai.com](http://d.moomai.com)’

jeremy

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 18, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/assets-d-domain-com/123490/3 "2007-12-18T18:01:56Z")

</div>

Hmm, now the links are becoming: … pretty sure that’s not how it’s supposed to work. Any  
thing else I can try?

---

<div class="post-metadata">

**Author:** ![luisS\_syndeomedia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/85e7bf/32.png) [@luisS\_syndeomedia](https://www.ruby-forum.com/u/luisS_syndeomedia)\
**Post date:** [December 19, 2007, 4:09am UTC](https://www.ruby-forum.com/t/assets-d-domain-com/123490/4 "2007-12-19T04:09:41Z")

</div>

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](http://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
