Sha256: 45491c955fa9502c9ac48afeb13e809a21d49ece483c1bfa0fdefddcfaaad203
Contents?: true
Size: 664 Bytes
Versions: 80
Compression:
Stored size: 664 Bytes
Contents
module Spree module Api module V1 class CustomerReturnsController < Spree::Api::BaseController def index collection(Spree::CustomerReturn) respond_with(@collection) end private def collection(resource) return @collection if @collection.present? params[:q] ||= {} @collection = resource.all # @search needs to be defined as this is passed to search_form_for @search = @collection.ransack(params[:q]) @collection = @search.result.order(created_at: :desc).page(params[:page]).per(params[:per_page]) end end end end end
Version data entries
80 entries across 80 versions & 1 rubygems