diff options
author | rhenium <re4k@re4k.info> | 2013-06-01 21:09:41 +0900 |
---|---|---|
committer | rhenium <re4k@re4k.info> | 2013-06-01 21:09:41 +0900 |
commit | fb2a7041165e4cc0a6c488b3b78390ca98357169 (patch) | |
tree | 9495f2ef2ce0aa15b41bcaa8b7a46a5b6f51330d | |
parent | 5e0d231be08d95ac30746ad419db543cb5ccfe93 (diff) | |
download | aclog-fb2a7041165e4cc0a6c488b3b78390ca98357169.tar.gz |
update view tweets/_tweets.html.haml: no pagination links when no tweets
-rw-r--r-- | app/views/tweets/_tweets.html.haml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/views/tweets/_tweets.html.haml b/app/views/tweets/_tweets.html.haml index d0030b2..882a735 100644 --- a/app/views/tweets/_tweets.html.haml +++ b/app/views/tweets/_tweets.html.haml @@ -1,9 +1,8 @@ -.tweets - = render partial: "tweets/tweet", collection: @tweets.includes(:user), as: :tweet -.loading - = image_tag "loading.gif", alt: "loading...", title: nil -.pagination - - if params[:page] - = link_to raw("Next ›"), params.merge(page: params[:page].to_i + 1), rel: :next - - elsif @tweets.last - = link_to raw("Next ›"), params.merge(max_id: @tweets.last.id - 1), rel: :next +.tweets= render partial: "tweets/tweet", collection: @tweets.includes(:user), as: :tweet += if @tweets.count > 0 + .loading= image_tag "loading.gif", alt: "loading...", title: nil + .pagination + - if params[:page] + = link_to raw("Next ›"), params.merge(page: params[:page].to_i + 1), rel: :next + - elsif @tweets.last + = link_to raw("Next ›"), params.merge(max_id: @tweets.last.id - 1), rel: :next |