Skip to content

Commit

Permalink
Disable pagination for now
Browse files Browse the repository at this point in the history
Using distinct: true with Ransack interfering with Kaminari
  • Loading branch information
mwean committed Sep 18, 2013
1 parent 4fafdae commit 68c904e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ class ArticlesController < ApplicationController

def index
@search = Article.includes(:volume, :authors).search(params[:q])
@articles = @search.result.sort_by_volume_number_and_first_page.page(params[:page]).decorate
@articles = @search.result.sort_by_volume_number_and_first_page.decorate
# .page(params[:page]).decorate

respond_to do |format|
format.html
Expand Down
2 changes: 1 addition & 1 deletion app/views/articles/_article_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
%td= article.title
%td{ class: [:nowrap, :center] }
= article.pages
%tfoot= paginate @articles, remote: true
/ %tfoot= paginate @articles, remote: true
20 changes: 10 additions & 10 deletions spec/features/articles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
expect(page).to have_css('table.articles tr', text: article.title)
end

scenario 'articles are paginated' do
Article.paginates_per(1)
article1 = FactoryGirl.create(:article, pages: '1')
article2 = FactoryGirl.create(:article, pages: '2')
visit articles_path
# scenario 'articles are paginated' do
# Article.paginates_per(1)
# article1 = FactoryGirl.create(:article, pages: '1')
# article2 = FactoryGirl.create(:article, pages: '2')
# visit articles_path

expect(page).to have_content(article1.title)
expect(page).to have_no_content(article2.title)
# expect(page).to have_content(article1.title)
# expect(page).to have_no_content(article2.title)

click_on 'Next'
# click_on 'Next'

expect(page).to have_content(article2.title)
end
# expect(page).to have_content(article2.title)
# end
end

0 comments on commit 68c904e

Please sign in to comment.