Reputation: 11
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
Upvotes: 0
Views: 273
Reputation: 8295
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.
Upvotes: 2