Class: Workarea::Admin::PricesController
Instance Method Summary
collapse
#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model
Methods included from Publishing
#allow_publishing!, #allow_publishing?, #set_publishing_options
Methods included from Visiting
#most_visited
Instance Method Details
#create ⇒ Object
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 16
def create
if @price.save
flash[:success] =
t('workarea.admin.prices.flash_messages.saved', sku: @sku.id)
redirect_to pricing_sku_prices_path(@sku)
else
render :index, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
39
40
41
42
43
44
45
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 39
def destroy
@price.destroy
flash[:success] =
t('workarea.admin.prices.flash_messages.deleted', sku: @sku.id)
redirect_to pricing_sku_prices_path(@sku)
end
|
#edit ⇒ Object
26
27
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 26
def edit
end
|
#index ⇒ Object
10
11
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 10
def index
end
|
#new ⇒ Object
13
14
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 13
def new
end
|
#update ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/workarea/admin/prices_controller.rb', line 29
def update
if @price.update_attributes(price_params)
flash[:success] =
t('workarea.admin.prices.flash_messages.saved', sku: @sku.id)
redirect_to pricing_sku_prices_path(@sku)
else
render :edit, status: :unprocessable_entity
end
end
|