ruby on rails will_paginate (given 2, expected 1) error

246 Views Asked by At

this is Article controller

def index
    @articles = Article.all
    @articles = Article.paginate(page: params[:page], per_page: 5)
  end

views code

<div class="flickr_pagination">
  <%= will_paginate @articles, :container => false %>
</div>
<%= render 'article' %>
<div class="flickr_pagination mb-4">
  <%= will_paginate @articles, :container => false %>
</div>

Error : ArgumentError in Articles#index Showing C:/Users/Murat/Desktop/Ruby/blog/app/views/articles/index.html.erb where line #4 raised:

wrong number of arguments (given 2, expected 1)

1

There are 1 best solutions below

0
rewritten On

It seems that the error is raised at line 4 of your template, where you call render 'article' so the problem might be completely unrelated with will_paginate.