I am working in Padrino and have this in my controller
@work.find_by_id(params[:id])
I want to add prev/next buttons into my view, and so must be able to get the path to the next item on the list. How can I do that with ActiveRecord?
I am working in Padrino and have this in my controller
@work.find_by_id(params[:id])
I want to add prev/next buttons into my view, and so must be able to get the path to the next item on the list. How can I do that with ActiveRecord?
You may want to checkout the ActsAsAdjacent plugin. I'm not sure if you can use plugins with Padrino, but the code is pretty simple, and should be able to adapt to your needs.