Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4631

ruby number to human-readable string conversion

$
0
0

I need to have a list with id's for each list item being #one, #two etc.Is this the most efficient way or am I missing an in built ruby function here?

-num_array = ["one", "two", "three", "four", "five", "six", "seven"]-navigation[:primary_level].each_with_index do |primary_item, idx|   %li{ :id => "#{num_array[idx]}"}

Viewing all articles
Browse latest Browse all 4631

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>