Ruby on Rails
Monday, November 29, 2010
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.
--
With Regards,
Palani
-- <% @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.
--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment