# Dynamic Text Replacement

**URL:** <https://www.ruby-forum.com/t/dynamic-text-replacement/53666>\
**Category:** Rails\
**Created:** [December 15, 2005, 9:56pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666 "2005-12-15T21:56:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 15, 2005, 9:56pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/1 "2005-12-15T21:56:42Z")

</div>

I noticed there are a lot of PHP based dynamic text replacement  
examples out there such as:  
[http://artypapers.com/csshelppile/pcdtr/](http://artypapers.com/csshelppile/pcdtr/)

Is there anything like this for Ruby / Rails? I know there’s always  
SiFR but that method is often frustrating because I’ve noticed  
significant slow down in page load time even on pages that use it  
sparingly.

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 15, 2005, 10:29pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/2 "2005-12-15T22:29:55Z")

</div>

> Is there anything like this for Ruby / Rails?Â

I have something similar in my PHP framework. It’s the perfect approach  
IMHO.

So who’s the first to claim RoR image replacement? If I get around it on  
time  
I’ll give it a shot.

- Fabien

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 15, 2005, 10:51pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/3 "2005-12-15T22:51:29Z")

</div>

Can someone explain why I would want to do this? After looking at the  
example, I just don’t see the usefullness of this feature.

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 20, 2005, 4:03pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/4 "2005-12-20T16:03:38Z")

</div>

Mainly, its there so you can put your headers in fonts that the user may  
not  
have on his PC.

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 20, 2005, 4:15pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/5 "2005-12-20T16:15:40Z")

</div>

Got it… go through a lot of extra work to have someone view a graphic  
instead of plain text.

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 22, 2005, 4:18pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/6 "2005-12-22T16:18:20Z")

</div>

Right, althogh ideally, once you put the framework in place, it would  
minimize (or even eliminate) the “a lot of extra work” part, at least on  
your part (obviously the server still has to slave away serving the  
images).

---

<div class="post-metadata">

**Author:** ![aantix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@aantix](https://www.ruby-forum.com/u/aantix)\
**Post date:** [December 22, 2005, 7:07pm UTC](https://www.ruby-forum.com/t/dynamic-text-replacement/53666/7 "2005-12-22T19:07:59Z")

</div>

Hi,

I’ve just implemented the exact thing you are after on our new blog,  
[Vivabit | The Web's Cutting Edge](http://www.vivabit.com/bollocks) using RMagick. I’d like to release  
the code soon but I’ve not got it up to library standard yet  
(configuration is not as easy as it would need to be for general use).  
Its a little more complex than the PHP ones posted because we wanted  
the replaced text to wrap in liquid layouts and we didn’t use the  
native text rendering because it was a bit nasty and my design  
collegue is really picky (see this post:  
[Vivabit | The Web's Cutting Edge](http://www.vivabit.com/bollocks/2005/12/19/magick-images-image-replacement-in-liquid-layouts-and-really-really-really-long-headings)  
)

If you can wait untill after xmas I’ll release it as a plugin…when  
it’s out I’d love some feedback.

Cheers,

Dan

On 12/22/05, Andrew S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > > 
> > > > 
> > > > removed\_email\_address@domain.invalid
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Dan W.  
[http://www.danwebb.net](http://www.danwebb.net)
