title: How to solve undefined method `paginate' for Searchkick in rails?
body: <p>I am trying to use autocomplete with searchkick gem but I'm getting this error
  undefined method `paginate' for #
  here is my post_controller.rb file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class PostsController &lt; ApplicationController
    impressionist
    before_action :set_post, only: [:show, :edit, :update, :destroy]
    before_action :authenticate_user!, except: [:index, :show]
    def index
    @email = current_user.try(:email)
    if params[:category].blank?
      @posts = Post.search(params[:query]).paginate(page: params[:page], per_page: 10)
    else
      @category_id = Category.find_by(name: params[:category]).id
      @posts = Post.where(category_id: @category_id).paginate(page: params[:page], per_page: 10)
    end
    end
    def show
    end
    def new
      @post = current_user.posts.build
    end
    def edit
    end
    def create
      @post = current_user.posts.build(post_params)
  
      respond_to do |format|
        if @post.save
          format.html { redirect_to @post, notice: 'Post was successfully created.' }
          format.json { render :show, status: :created, location: @post }
        else
          format.html { render :new }
          format.json { render json: @post.errors, status: :unprocessable_entity }
        end
      end
    end
    def update
      respond_to do |format|
        if @post.update(post_params)
          format.html { redirect_to @post, notice: 'Post was successfully updated.' }
          format.json { render :show, status: :ok, location: @post }
        else
          format.html { render :edit }
          format.json { render json: @post.errors, status: :unprocessable_entity }
        end
      end
    end
    def destroy
      @post.destroy
      respond_to do |format|
        format.html { redirect_to posts_url, notice: 'Post was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
    private
      def set_post
        @post = Post.find(params[:id])
        @comments = @post.comments.all
        @comment = @post.comments.build
      end
      def post_params
        params.require(:post).permit(:title, :description, :video, :category_id)
      end
      def video
        self.link.split('/').last if self.link
      end
      def autocomplete
        render json: Post.search(params[:query], autocomplete: true, limit: 10).map(&amp;:title)
      end
  end</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the post.rb file is</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class Post &lt; ActiveRecord::Base
   is_impressionable
   has_many :comments
   belongs_to :category
   belongs_to :user
   searchkick autocomplete: ["title"]
  end</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the index.html.erb file is</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;%- model_class = Post -%&gt;
  &lt;% @title="Know Your Operating System-posts" %&gt;
  &lt;div class="page-header"&gt;
    &lt;h1&gt;Tips And Tricks For Your Operating System&lt;small&gt;&lt;/small&gt;&lt;/h1&gt;
  &lt;/div&gt;
  &lt;%= form_tag posts_path, class: "form-inline", method: :get do %&gt;
    &lt;div class="input-group input-group-lg"&gt;
      &lt;% if params[:query].present? %&gt;
        &lt;div class="input-group-btn"&gt;
          &lt;%= link_to "clear", posts_path, class: "btn btn-default" %&gt;
        &lt;/div&gt;
      &lt;% end %&gt;
      &lt;%= text_field_tag :query, params[:query], class: "form-control", id: "post_search", autocomplete: "off" %&gt;
      &lt;div class="input-group-btn"&gt;
        &lt;%= submit_tag "Search", class: "btn btn-primary" %&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  &lt;table class="table table-striped"&gt;
    &lt;tbody&gt;
      &lt;% @posts.each do |post| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= link_to post.title, post_path(post) %&gt;&lt;/td&gt;
            &lt;td&gt;
              &lt;% if current_user.try(:email) == 'kowshik16.kk@gmail.com' || current_user.try(:email) == 'chaitanyamalineni488@gmail.com' || current_user.try(:email) == 'harikirandev@gmail.com' || current_user.try(:email) == 'bobbasai33@gmail.com' || current_user.try(:email) == 'sreevaishu15@gmail.com' %&gt;
                &lt;%= post.impressionist_count %&gt;
              &lt;% end %&gt;
            &lt;/td&gt;
          &lt;td&gt;
            &lt;% if post.user == current_user %&gt;
            &lt;%= link_to t('.edit', :default =&gt; t("helpers.links.edit")),
                        edit_post_path(post), :class =&gt; 'btn btn-default btn-xs' %&gt;
            &lt;%= link_to t('.destroy', :default =&gt; t("helpers.links.destroy")),
                        post_path(post),
                        :method =&gt; :delete,
                        :data =&gt; { :confirm =&gt; t('.confirm', :default =&gt; t("helpers.links.confirm", :default =&gt; 'Are you sure?')) },
                        :class =&gt; 'btn btn-xs btn-danger' %&gt;
            &lt;% end %&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;table&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;
            &lt;%= will_paginate @posts, inner_window: 2, outer_windows: 2 %&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is my gem file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>source 'https://rubygems.org'
  ruby "2.2.2"
  gem 'rails', '4.2.1'
  group :production do
    gem 'pg'
    gem 'rails_12factor'
  end
  gem 'searchkick'
  gem 'impressionist'
  gem 'mysql2'
  gem "therubyracer"
  gem "less-rails" 
  gem 'sass-rails'
  gem 'uglifier'
  gem 'coffee-rails'
  gem "twitter-bootstrap-rails"
  gem 'jquery-rails'
  gem 'turbolinks'
  gem 'jbuilder'
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  gem 'devise'
  gem 'will_paginate'
  gem 'mail_form', '~&gt; 1.5', '&gt;= 1.5.1'
  gem 'simple_form'
  gem 'ckeditor'
  gem 'carrierwave'
  gem 'mini_magick'
  gem 'activeadmin', github: 'gregbell/active_admin'
  group :development, :test do
    gem 'byebug'
    gem 'web-console'
    gem 'spring'
  end</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I solve the error</p>