个人主页列表的翻页

This commit is contained in:
cxt 2016-10-19 20:33:39 +08:00
parent dde8be3f94
commit e5cfcdc038
2 changed files with 5 additions and 17 deletions

View File

@ -45,15 +45,9 @@ class HomepagesController < ApplicationController
@is_remote = true
@atta_count = @articles.count
@atta_pages = Paginator.new @atta_count, @limit, 1
@offset ||= @atta_pages.offset
@articles = paginateHelper @articles,@limit
if params[:show]
redirect_to user_homepages_path(:user_id => @user.id)
return
else
respond_to do |format|
format.js
end
end
redirect_to user_homepages_path(:user_id => @user.id)
end
def cancel_homepage
@ -69,15 +63,9 @@ class HomepagesController < ApplicationController
@is_remote = true
@atta_count = @articles.count
@atta_pages = Paginator.new @atta_count, @limit, 1
@offset ||= @atta_pages.offset
@articles = paginateHelper @articles,@limit
if params[:show]
redirect_to user_homepages_path(:user_id => @user.id)
return
else
respond_to do |format|
format.js
end
end
redirect_to user_homepages_path(:user_id => @user.id)
end
private

View File

@ -1 +1 @@
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'articles') %>');
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'article_list') %>');