# Attachment\_fu && image caching

**URL:** <https://www.ruby-forum.com/t/attachment-fu-image-caching/196797>\
**Category:** Rails\
**Created:** [August 31, 2008, 11:38am UTC](https://www.ruby-forum.com/t/attachment-fu-image-caching/196797 "2008-08-31T11:38:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valery\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ee7513/32.png) [@Valery\_K](https://www.ruby-forum.com/u/Valery_K)\
**Post date:** [August 31, 2008, 11:38am UTC](https://www.ruby-forum.com/t/attachment-fu-image-caching/196797/1 "2008-08-31T11:38:07Z")

</div>

I have a little problem:

I’m operating with attachment\_fu object (:storage =\> :file\_system),  
for instance @image.  
When I have to render it into the view, i’d like to use native helper \<  
%= image\_tag(@image.public\_filename) %\>, it generates the HTML code  
something like “ ![](https://test.ruby-forum.com/images/image.jpg?2342323). I suppose that  
digits after the ‘?’ is caching stuff. (?)  
How can I get clean filepath?. Just now i constrained to be using ‘The-  
Not-Rails-Way’: i’m ducking pure html tags \<img  
src=”\<%=@image.public\_filename  
%\>, thats a problem.

That is because my application logic needs to get in the next redirect  
action the renewed (post cropped) image, but not clean image path  
return me the previous image. Intresting that problem is actual just  
in IE and Opera. Safari and Firefox works just fine.

Thanks.

---

<div class="post-metadata">

**Author:** ![Valery\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ee7513/32.png) [@Valery\_K](https://www.ruby-forum.com/u/Valery_K)\
**Post date:** [August 31, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/attachment-fu-image-caching/196797/2 "2008-08-31T14:59:25Z")

</div>

On Aug 31, 10:37 am, Valery K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a little problem:
> 
> I’m operating with attachment\_fu object (:storage =\> :file\_system),  
> for instance @image.  
> When I have to render it into the view, i’d like to use native helper \<  
> %= image\_tag(@image.public\_filename) %\>, it generates the HTML code  
> something like " ![](https://www.ruby-forum.com/images/image.jpg?2342323). I suppose that  
> digits after the ‘?’ is caching stuff. (?)

the digits are a timestamp for the file (so that if the file has  
changed the browser is forced to re-request it

> How can I get clean filepath?. Just now i constrained to be using ‘The-  
> Not-Rails-Way’: i’m ducking pure html tags \<img src="\<removed\_email\_address@domain.invalid\_filename  
> %\>, thats a problem.

Have you checked the output to see if that’s generating the img tag  
you would expect?

Fred

---

<div class="post-metadata">

**Author:** ![Valery\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ee7513/32.png) [@Valery\_K](https://www.ruby-forum.com/u/Valery_K)\
**Post date:** [August 31, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/attachment-fu-image-caching/196797/3 "2008-08-31T15:56:47Z")

</div>

On 31.08.2008, at 16:58, Frederick C. wrote:

> > How can I get clean filepath?. Just now i constrained to be using  
> > ‘The-  
> > Not-Rails-Way’: i’m ducking pure html tags \<img src="\<  
> > removed\_email\_address@domain.invalid\_filename  
> > %\>, thats a problem.
> 
> Have you checked the output to see if that’s generating the img tag  
> you would expect?

Yes! the pure ![]() generates exactly I need - filepath without  
timestamps and application works fine in all browsers.
