Having buttons to go to the next or back out of an actice record is a desired function, for example, when creating a photo album. So how can one create this functionality in Rails?
Class:
In my case this is in the photo class
View:
This is from the view file
So by retrieving higher or lower than the id that we have currently uploaded, we get the next and earlier, in my case I have also added user_id to filter on which user uploaded. This could of course be a different filter or be missing altogether.