On 29 November 2010 16:23, PalaniKannan K <kpalanikan...@gmail.com> wrote: > Yes I accept, any other way to extract the distinct content from each array?
Which array? The "sp_ref.all_references" array that you're iterating, or a different one? Are you're asking "how would I get a collection of distinct "reference" values from each collection of "sp_ref.all_references"? If so this might help... <% @sp_references.each do |sp_ref| %> <%= sp_ref.all_references.map(&:reference).uniq.delete_if{|ref| ref =~ /emend$/i}.join("<br/>") %> <% end %> ... you could break it apart into separate operations if you wished. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.