Emotikonki

Witajcie,
Chcę dodać opcje emotikonek w mojej “piaskownicy”, zrobiłem tak:
Enviroment

require 'lib/smiles'

Lib/smiles.rb

class RedCloth def smilies(text) text.gsub!(/\:\-\)|\:\)/, '<img src="/images/emoticons/smile.png" alt="smile" />') text.gsub!(/\;\-\)|\;\)/, '<img src="/images/emoticons/wink.png" alt="wink" />') text.gsub!(/\:\-\(|\:\(/, '<img src="/images/emoticons/sad.png" alt="sad" />') end end
app_helper

def format_text(text) RedCloth.new(text).to_html(:textile, :smilies) end
View:

  <%= format_text ":)" %>

Niestety to nie działa, nie zmienia nic, wyświetla samo :slight_smile: jako tekst. Co robie nie tak? Używam najnowszego RedCloth 4.

Przede wszystkim skoro zastępujesz statyczne stringi, to nie dawaj gsubowi jako argumentu wyrażenia regularnego :slight_smile: