fixed notes loading/paging
This commit is contained in:
parent
0b0e0225ad
commit
586c53ea05
6 changed files with 47 additions and 15 deletions
|
@ -83,4 +83,16 @@ class ApplicationController < ActionController::Base
|
|||
cookies[:view_style] = ""
|
||||
end
|
||||
end
|
||||
|
||||
def respond_with_notes
|
||||
if params[:last_id] && params[:first_id]
|
||||
@notes = @notes.where("id >= ?", params[:first_id])
|
||||
elsif params[:last_id]
|
||||
@notes = @notes.where("id > ?", params[:last_id])
|
||||
elsif params[:first_id]
|
||||
@notes = @notes.where("id < ?", params[:first_id])
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue