All pastes #410266 Raw Edit

Anonymous

public ruby v1 · immutable
#410266 ·published 2007-03-26 07:33 UTC
rendered paste body
def linkify_sales_letter  logger.info("Linkifying sales letter!\n")  #check for articles  if self.articles.length > 0     logger.info("Articles length greater than zero...\n")     for article in self.articles     #Check for keywords in each copy field     if self.introduction.length > 0         logger.info("My introduction is not nill")         word_array = article.keywords.split(' ')          logger.info("#{word_array}\n")         for word in word_array              if self.introduction.match(word)                   logger.info("#{word} matches our introduction!")                   logger.info(self.introduction.gsub!(/word/, "<a                       href='/products/#{self.name}/article/#{article.id}'>#{word}</a>"))                 end              end         end                    end      else      return     end  end