Displaying 1 result from an estimated 1 matches for "method_to_construct_link_for_name".
2010 Mar 03
0
Using gsub to replace text with link from database
...[A-Z]+[a-zA-Z]*)/)
@full_text_array.each_with_index do |original_name, i|
@full_text.gsub!(original_name.to_s, @new_link_array[i])
end
results = @full_text.scan(/([A-Z]+[a-zA-Z]* [A-Z]+[a-zA-Z]*)/)
names_links = {}
results.each do |name|
unless names_links[name]
names_links[name] = method_to_construct_link_for_name(name)
end
end
names_links.each_pair do |name, link|
@full_text.gsub!(name, link)
end
The results are not consistent. I was wondering if somebody could help
me out.
-A
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups &...