actually correct order of prev/next info

This commit is contained in:
jomo
2015-01-27 22:54:47 +01:00
parent 7ae24024dd
commit dc60251ab4

View File

@@ -8,8 +8,8 @@ class InfoController < ApplicationController
end
def show
@prev = Info.where(["id < ?", @info.id]).order(:title).last || Info.order(:title).last
@next = Info.where(["id > ?", @info.id]).order(:title).first || Info.order(:title).first
@prev = Info.where(["title < ?", @info.title]).order(:title).last || Info.order(:title).last
@next = Info.where(["title > ?", @info.title]).order(:title).first || Info.order(:title).first
end
def new