1、解决项目搜素 分页异常问题
This commit is contained in:
parent
d1418f1bbe
commit
d67d21eb42
|
@ -86,8 +86,14 @@ class ProjectsController < ApplicationController
|
|||
@project_pages = Project.project_entities.visible.like(params[:name]).page(params[:page]).per(10)
|
||||
else
|
||||
@project_pages = Project.project_entities.visible.page(params[:page] ).per(10)
|
||||
@project_pages = Project.project_entities.visible.page(params[:page] ).per(10)
|
||||
end
|
||||
@projects = @project_pages.order("created_on desc")
|
||||
@limit = 10#per_page_option
|
||||
|
||||
@project_count = Project.project_entities.visible.like(params[:name]).page(params[:page]).count
|
||||
@project_pages = Paginator.new @project_count, @limit, params['page']
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
render :layout => 'base'
|
||||
|
|
|
@ -104,9 +104,13 @@
|
|||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @project_pages, @user_count %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<%= paginate @project_pages %>
|
||||
<%#= paginate @project_pages %>
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue