collab/app/helpers/projects_helper.rb

14 lines
355 B
Ruby
Raw Normal View History

2010-03-04 06:22:45 +00:00
module ProjectsHelper
2010-03-15 15:47:32 +00:00
def parse_wall_string(string)
user_matches = string.scan(/@([a-zA-Z_0-9]+)/).flatten
return string if user_matches.empty?
User.find_all_by_short_name(user_matches).each do |user|
string.gsub!("@#{user.short_name}", link_to("@#{user.short_name}", user_path(user.short_name)))
end
string
end
2010-03-04 06:22:45 +00:00
end