Sha256: bfbd5af1b3bea7defd8531bd30721a5e1295ec229a5ed8e15b43c7fef5601409

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

module Spree
  module Admin
    class LabelsController < ResourceController
      def index
        session[:return_to] = request.url
        respond_with @collection
      end

      def collection
        return @collection if @collection.present?
        params[:q] ||= {}
        @collection = super
        # @search needs to be defined as this is passed to search_form_for
        Ransack.options[:ignore_unknown_conditions] = false
        @search = @collection.ransack(params[:q])
        @collection = @search.result.
            page(params[:page]).
            per(params[:per_page] || Spree::Config[:admin_products_per_page])
        @collection
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_zaez_variants_labels-3.0.5 app/controllers/spree/admin/labels_controller.rb
spree_zaez_variants_labels-3.0.4 app/controllers/spree/admin/labels_controller.rb
spree_zaez_variants_labels-3.0.1 app/controllers/spree/admin/labels_controller.rb