ruby - Rails 4 will_paginate on my comments article show page -
i having hard time reason getting will_paginate gem work rails blog app under comments on articles. have articles paginating fine on index. trying paginate comments on articles show page. not getting errors , links next , previous pages show getting stuck on first page comments when hit next doesn't go next page, if makes since. below articles controller , show view. appreciative. thanks!
@comments = @article.comments.paginate(:page => params[:page], :per_page => 2) <%= will_paginate @comments, renderer: bootstrappagination::rails %> def show @article = article.find(params[:id]) @comments = @article.comments.paginate(:page => params[:page], :per_page => 2) @tags = tag.all @categories = category.all end def index @articles = article.paginate(:page => params[:page], :per_page => 5).order("created_at desc") @tags = tag.all @categories = category.all end <%= will_paginate @comments, renderer: bootstrappagination::rails %> <%= render @article.comments %>
Comments
Post a Comment