Class: Spree::Admin::PricesController

Inherits:
ResourceController show all
Defined in:
app/controllers/spree/admin/prices_controller.rb

Instance Method Summary collapse

Methods inherited from ResourceController

belongs_to, #create, #destroy, #new, #update, #update_positions

Methods included from SetsUserLanguageLocaleKey

#set_user_language_locale_key

Instance Method Details

#editObject



24
25
# File 'app/controllers/spree/admin/prices_controller.rb', line 24

def edit
end

#indexObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/spree/admin/prices_controller.rb', line 8

def index
  params[:q] ||= {}

  @search = @product.prices.kept.accessible_by(current_ability, :index).ransack(params[:q])
  @master_prices = @search.result
    .currently_valid
    .for_master
    .order(:variant_id, :country_iso, :currency)
    .page(params[:page]).per(Spree::Config.admin_variants_per_page)
  @variant_prices = @search.result
    .currently_valid
    .for_variant
    .order(:variant_id, :country_iso, :currency)
    .page(params[:variants_page]).per(Spree::Config.admin_variants_per_page)
end