Class: Workarea::Admin::FulfillmentSkusController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/fulfillment_skus_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#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

#createObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 16

def create
  if @sku.save
    flash[:success] =
      t('workarea.admin.fulfillment_skus.flash_messages.created', id: @sku.id)
    redirect_to fulfillment_sku_path(@sku)
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject



37
38
39
40
41
42
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 37

def destroy
  @sku.destroy

  flash[:success] = t('workarea.admin.fulfillment_skus.flash_messages.removed', id: @sku.id)
  redirect_to fulfillment_skus_path
end

#editObject



26
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 26

def edit; end

#indexObject



9
10
11
12
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 9

def index
  search = Search::AdminFulfillmentSkus.new(view_model_options)
  @search = SearchViewModel.new(search, view_model_options)
end

#showObject



14
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 14

def show; end

#updateObject



28
29
30
31
32
33
34
35
# File 'app/controllers/workarea/admin/fulfillment_skus_controller.rb', line 28

def update
  if @sku.update(params[:sku])
    flash[:success] = t('workarea.admin.fulfillment_skus.flash_messages.saved', id: @sku.id)
    redirect_to fulfillment_sku_path(@sku)
  else
    render :edit, status: :unprocessable_entity
  end
end