mardi 1 septembre 2020

Rails, NoMethodError - undefined method `paginate' for #

    posts =  ActiveRecord::Base.connection.execute(query + ' where ' + query1)
    @posts = posts.paginate(page: params[:page], per_page: 50)

Tried to do pagination, but giving error undefined method `paginate'

pagination used in view.

    <div class="col-xs-12 col-sm-12 col-md-12"><%= will_paginate @posts, class: 'pull-right marg', renderer: BootstrapPagination::Rails %></div>

Aucun commentaire:

Enregistrer un commentaire