I am trying to output an alphabetically sorted list of tags.
If I use: <% blog.tags.sort{ |a,b| a.downcase <=> b.downcase }.each do |tag, articles| %>
, I get a NoMethodError
:
undefined method
downcase’ for #`.
I can use <% blog.tags.sort{ |a,b| a <=> b }.each do |tag, articles| %>
to sort alphabetically by uppercase then lowercase which is passable but not what I intended.
Could someone point out my head-slapping error?