I’m writing a web app that lets users browse through attractions in regions, states and countries. Currently I have the app set up in a way where attractions belong to regions, regions belong to states, and states belong to countries.
What I’m trying to do is write the view for a State. I’m trying to come up with a way to get lists of regions and the attractions in them, so something like
STATE
- Region 1
- Attraction 1
- Attraction 2
- Region 2
- Attraction 3
- Attraction 4
but I have been unable to come up with a way to do this that feels “right”.
I’m using Sinatra and Datamapper with MySQL, if that helps.
With the states data :
In the view (HAML) :