0

I just finished the default example project from Rails which is a blog, I decided to do a pagination with Kaminari. I'm using Rails 4.2.5 and kaminari 0.16.3. and when I try to paginate the index page where posts are displayed kaminari paginates the posts but it doesnt show the pagination links.

This is my code:

ArticlesController:

def index
@articles = Article.all.page(params[:page]).per(1)
end

View

<% paginate @articles  %>
<% @articles.each do |article| %>
#print each article
<% end %>

Also I generated the views directory with the command: bundle install -g kaminari -e erb

1 Answers1

2

You have a typo in your view file

you need to use

<%= paginate @articles %>

instead of

<% paginate @articles %>

in order to actually display the results of the ruby code to the html.

xlembouras
  • 8,215
  • 4
  • 33
  • 42