# Custom Links in User Profile

**URL:** <https://www.ruby-forum.com/t/custom-links-in-user-profile/149269>\
**Category:** Rails\
**Created:** [September 23, 2008, 6:12am UTC](https://www.ruby-forum.com/t/custom-links-in-user-profile/149269 "2008-09-23T06:12:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [September 23, 2008, 6:12am UTC](https://www.ruby-forum.com/t/custom-links-in-user-profile/149269/1 "2008-09-23T06:12:49Z")

</div>

I want my users to be able to insert links in their profile, but  
obviously they can’t use html.

I want to solve this by allowing them to do  
[link=“[http://theirurl.com](http://theirurl.com)”][/link]. Any idea how I would go about  
this?

Thanks!

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [September 23, 2008, 7:18am UTC](https://www.ruby-forum.com/t/custom-links-in-user-profile/149269/2 "2008-09-23T07:18:16Z")

</div>

I would consider using Textile or Markdown. Take a look at the  
RedCloth gem. [http://whytheluckystiff.net/ruby/redcloth/](http://whytheluckystiff.net/ruby/redcloth/)

-Dan M.  
[http://www.dcmanges.com/blog](http://www.dcmanges.com/blog)

On Sep 22, 11:12 pm, Kyle M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [September 23, 2008, 9:42am UTC](https://www.ruby-forum.com/t/custom-links-in-user-profile/149269/3 "2008-09-23T09:42:27Z")

</div>

linker = Regexp.new(/[link="(._?)"](._?)[/link]/)

\<%= @user.profile.gsub(linker){|m| “#{m[1]}”} %\>

On Sep 23, 12:12 am, Kyle M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
