appending <a href> to keywords in rails

Posted by kim on Stack Overflow See other posts from Stack Overflow or by kim
Published on 2010-05-26T10:57:01Z Indexed on 2010/05/26 11:01 UTC
Read the original article Hit count: 300

Filed under:
|
|

Basically, there are some keywords that i want to pick out and assign a link to them dynamically.

How should i go about in doing this?

Let's say i have something like this;

<p>ruby, rails, php, python, django and sinatra</p>

and i would like to assign links to keywords like ruby and python, so the end results should look like this;

<p><a href="http://www.ruby-lang.org">ruby</a>, rails, php, <a href="http://www.python.org">python</a>, django and sinatra</p>

Any help or suggestion would be much appreciated!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about ruby-on-rails