# Attachment\_fu - leading slash problem

**URL:** <https://www.ruby-forum.com/t/attachment-fu-leading-slash-problem/128570>\
**Category:** Rails\
**Created:** [February 8, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/attachment-fu-leading-slash-problem/128570 "2008-02-08T23:09:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c2a13f/32.png) [@Robin\_F](https://www.ruby-forum.com/u/Robin_F)\
**Post date:** [February 8, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/attachment-fu-leading-slash-problem/128570/1 "2008-02-08T23:09:21Z")

</div>

Hi All,

I’m using attachment\_fu to handle uploading some images. I’m using the  
path\_prefix option to set the path as ‘public/portfolio\_images’ and  
this is then symlinked to an identically named directory in the shared  
folder.

My issue is that the public\_filename method is placing a leading slash  
on the image url. When I added a trailing slash to the base\_path  
method so that the regex would catch it, it adds a directory named  
images/ to the front of the url.

My image.rb is here: [Parked at Loopia](http://pastie.caboo.se/149478) This is the only  
redefinition of any methods I’ve done.

All help appreciated.

Robin
