Class: Spree::Admin::SolidusImporter::ImportsController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/spree/admin/solidus_importer/imports_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



10
11
12
13
14
15
16
# File 'app/controllers/spree/admin/solidus_importer/imports_controller.rb', line 10

def index
  @search = ::SolidusImporter::Import.ransack(params[:q])
  @imports = @search.result(distinct: true)
                    .page(params[:page])
                    .per(params[:per_page] || Spree::Config[:orders_per_page])
                    .order(id: :desc)
end

#showObject



18
19
20
21
22
# File 'app/controllers/spree/admin/solidus_importer/imports_controller.rb', line 18

def show
  @import = ::SolidusImporter::Import.find(params[:id])
  @search = @import.rows.ransack(params[:q])
  @import_rows = @search.result(distinct: true).page(params[:page]).per(params[:per_page]).order(id: :desc)
end