Class: Workarea::Admin::PricingDiscountCodeListsController
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
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 17
def create
if @code_list.save
flash[:success] = t('workarea.admin.pricing_discount_code_lists.flash_messages.generated')
redirect_to pricing_discount_code_list_path(@code_list)
else
flash[:error] = t('workarea.admin.pricing_discount_code_lists.flash_messages.saved_error')
render :new, status: :unprocessable_entity
end
end
|
#destroy ⇒ Object
39
40
41
42
43
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 39
def destroy
@code_list.destroy
flash[:success] = t('workarea.admin.pricing_discount_code_lists.flash_messages.removed')
redirect_to pricing_discount_code_lists_path
end
|
#edit ⇒ Object
27
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 27
def edit; end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 7
def index
@code_lists = Pricing::Discount::CodeList.all.page(params[:page])
end
|
#new ⇒ Object
15
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 15
def new; end
|
13
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 13
def promo_codes; end
|
#show ⇒ Object
11
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 11
def show; end
|
#update ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/workarea/admin/pricing_discount_code_lists_controller.rb', line 29
def update
if @code_list.update(params[:code_list])
flash[:success] = t('workarea.admin.pricing_discount_code_lists.flash_messages.updated')
redirect_to pricing_discount_code_list_path(@code_list)
else
flash[:error] = t('workarea.admin.pricing_discount_code_lists.flash_messages.saved_error')
render :edit, status: :unprocessable_entity
end
end
|