aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/tweets.js2
-rw-r--r--app/controllers/application_controller.rb4
-rw-r--r--app/views/shared/tweets.html.haml2
3 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/tweets.js b/app/assets/javascripts/tweets.js
index 24ce366..55972bf 100644
--- a/app/assets/javascripts/tweets.js
+++ b/app/assets/javascripts/tweets.js
@@ -10,7 +10,7 @@ $(function() {
$(".loading").hide();
}
});
- $("a[rel=next]").click(function() {
+ $("a[rel=next]").hide().click(function() {
$.autopager("load");
return false;
});
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 1379b19..25c9e2b 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -33,11 +33,11 @@ class ApplicationController < ActionController::Base
@items = a || blk.call
if max_id
- @items = @items.where("id <= ?", max_id)
+ @items = @items.where("tweets.id <= ?", max_id)
end
if since_id
- @items = @items.where("id > ?", since_id)
+ @items = @items.where("tweets.id > ?", since_id)
end
@items = @items.page(page || 1).per(count)
diff --git a/app/views/shared/tweets.html.haml b/app/views/shared/tweets.html.haml
index 4437cab..bce37c4 100644
--- a/app/views/shared/tweets.html.haml
+++ b/app/views/shared/tweets.html.haml
@@ -7,5 +7,5 @@
- if @items
- if params[:page]
= link_to_next_page @items, raw("Next &#8250;")
- - else
+ - elsif @items.last
= link_to raw("Next &#8250;"), params.merge(:max_id => @items.last.id - 1), :rel => :next