I follow railscast for Kaminari (http://railscasts.com/episodes/254-pagination-with-kaminari). But I am stuck with part of the controller.
In my controller, I have something like this:
def index @articles = (params[:mine] == "true") ? current_user.articles : Article.search(params[:search]) respond_to do |format| format.html format.json { render json: @articles } end end
And now I'm not sure how to combine the methods, order, page and per, as in screencast .order("name").page(params[:page]).per(5) . I keep getting the "order" of the method in the array. I know that I canβt call methods on arrays, but how else can I bind them?
source share