个人主页列表的翻页
This commit is contained in:
parent
dde8be3f94
commit
e5cfcdc038
|
@ -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
|
||||
|
|
|
@ -1 +1 @@
|
|||
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'articles') %>');
|
||||
$("#blog-list").replaceWith('<%= escape_javascript( render :partial => 'article_list') %>');
|
Loading…
Reference in New Issue