解决组织动态中,第二页重复显示第一页动态的问题
This commit is contained in:
parent
5eceb3d841
commit
c500fc13db
|
@ -100,7 +100,7 @@ class OrganizationsController < ApplicationController
|
||||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@page = params[:page]
|
@page = params[:page] ? params[:page].to_i : 1
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
<div class="homepagePostPortrait">
|
<div class="homepagePostPortrait">
|
||||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
|
||||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(act.user_id)} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %> 创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
|
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %> 创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
|
||||||
|
@ -103,6 +103,6 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if org_act_count == 10 %>
|
<% if org_act_count == 10 %>
|
||||||
<%= link_to "点击展开更多",organization_path(org,:page => page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
<%= link_to "点击展开更多",organization_path(org,:page => @page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue