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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/17/07, luis, syndeomedia <luis-oF7mpmH9JiMmlAP/+Wk3EA@public.gmane.org> wrote:> > 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?Give just the host name: config.action_controller.asset_host = ''asset%d.moomai.com'' jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? On Dec 18, 3:33 pm, "Jeremy Kemper" <jer...-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote:> On 12/17/07, luis, syndeomedia <l...-oF7mpmH9JiMmlAP/+Wk3EA@public.gmane.org> wrote: > > > > > > > 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? > > Give just the host name: > config.action_controller.asset_host = ''asset%d.moomai.com'' > > jeremy--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 On Dec 19, 1:01 am, "luis, syndeomedia" <l...-oF7mpmH9JiMmlAP/+Wk3EA@public.gmane.org> wrote:> 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? > > On Dec 18, 3:33 pm, "Jeremy Kemper" <jer...-w7CzD/W5Ocjk1uMJSBkQmQ@public.gmane.org> wrote: > > > On 12/17/07, luis, syndeomedia <l...-oF7mpmH9JiMmlAP/+Wk3EA@public.gmane.org> wrote: > > > > Stupid question time: > > > > I''ve recently moved our site to Rails 2.0 and am trying to get the > > >assethost 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, theassetlinks > > > 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? > > > Give just the host name: > > config.action_controller.asset_host = ''asset%d.moomai.com'' > > > jeremy--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---