1 2 3 4
def date(date, time = false) date = Date.parse(date) if date.class.is_a? String format = time ? "%B #{date.day}, %Y at #{date.strftime('%I').to_i}:%M %p" : "%B #{date.day}, %Y" ...
1 2 3
def highlight_text(input, words_to_highlight = [], wrapper = '*\1*') input.gsub(/\b(#{words_to_highlight.join("|")})\b/, wrapper) end
Ruby On Simple Text Replacement
by mvanholstyn,
November 16, 2007 04:30
bilson -- that code is runn...
