On Nov 29, 3:25 pm, PalaniKannan K <kpalanikan...@gmail.com> wrote: > hi, > > <% @sp_references.each do |sp_ref| %> > <% sp_ref.all_references.each_with_index do |tax_ref, i| %> > <%if (tax_ref.reference.uniq) && (tax_ref.reference !~ /emend$/i) %> > <%= tax_ref.reference %> > <%end%> > <%end%> > <%end%> > > This 'uniq' option to get distinct elements in tax_ref.reference is not > working. It shows "undefined method `uniq' for #<String:". Kindly help me > this regard to get the distinct elements from array using each in rails. >
Sounds like tax_ref.refrence is a string, not an array so calling uniq on it doesn't make any sense. Fred > -- > With Regards, > Palani -- 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.