actually correct order of prev/next info
This commit is contained in:
@@ -8,8 +8,8 @@ class InfoController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@prev = Info.where(["id < ?", @info.id]).order(:title).last || Info.order(:title).last
|
@prev = Info.where(["title < ?", @info.title]).order(:title).last || Info.order(:title).last
|
||||||
@next = Info.where(["id > ?", @info.id]).order(:title).first || Info.order(:title).first
|
@next = Info.where(["title > ?", @info.title]).order(:title).first || Info.order(:title).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
Reference in New Issue
Block a user