[Mongrel] --prefix, url_for and image_tag

Joey Geiger jgeiger at gmail.com
Fri Oct 26 12:21:05 EDT 2007

actually I thought this was on a different list. My solution solves a
rails issue that I had, and isn't really meant for mongrel
specifically, so as I said, there may be something better.

I was actually fixing the rails problem of using the incorrect path
since my rails application is tacked onto an existing server. I needed
to serve images from within the rails app and from the root of the
server using image_tag, which my solution allows.

# Enable serving of images, stylesheets, and javascripts from an asset server
config.action_controller.asset_host = "http://dev.website.com"

On 10/26/07, Geoff Coffey <gwcoffey at gmail.com> wrote:
> On Oct 26, 2007, at 6:22 AM, Joey Geiger wrote:
> > I had to modify image_tag and add in a "nostrip" attribute. If there's
> > a better way, please post it up.
> Would it be reasonable to check if source already begins with the
> prefix, and not prepend it in that case? I realize this would fail in
> some rare cases, but my guess is it would be the *right* behavior a
> majority of the time, and when it isn't you could work around it,
> perhaps with a "force" attribute or something similar, or simply by
> hard-coding the url.
> As it is now, you need a workaround for a typical case. With this
> change, I think you would need a workaround for an atypical case.
> Does that make sense? I can patch it if there's some consensus that
> it would be a worthwhile patch.
> Thanks!
> Geoff
>> Geoff Coffey | 602.384.1804
> 9 Tips for FileMaker 9
> http://sixfriedrice.com/wp/category/filemaker-9-tips/
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users

More information about the Mongrel-users mailing list