diff --git a/app/controllers/info_controller.rb b/app/controllers/info_controller.rb index 9b0d84a..e147639 100644 --- a/app/controllers/info_controller.rb +++ b/app/controllers/info_controller.rb @@ -8,8 +8,8 @@ class InfoController < ApplicationController end def show - @prev = Info.where(["id < ?", @info.id]).last || Info.last - @next = Info.where(["id > ?", @info.id]).first || Info.first + @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 end def new