Listing
How would you go about generating a page like this in Rails?
Each of the letters at the top of the page is a link to #a
, #b
, etc. Above each row <a name="a"></a>
tags need to be added for all the letters that occur between the previous row and this row.
Here is a sample array:
items = ["African", "Ambient", "Asian", "Avant-garde", "Blues", "Breakbeat", "Caribbean", "Comedy", "Country", "Disco", "Downtempo", "Drum & Bass", "Easy listening", "Electro", "Electronic", "Folk", "Hardcore", "Hardstyle", "Hip hop", "House", "Industrial", "Jazz", "Jungle", "Latin", "Pop", "R&B", "Rock", "Soul", "Techno", "Trance"]
See below for a staring point for writing a solution. I have an implementation already, I'm curious how others would solve it.