Whenever I loop through an array, there are times I wish I could know what comes before or after the item I am currently one. Including prev/next index calculations. This gem helps you with that. However, it would be better for you to create your own since you will probably not like my way of doing it.
Gemfile gem 'about_pos', '~> 0.1.0'
install gem install about_pos