Class: Workarea::Admin::CatalogCategoriesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/catalog_categories_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

#destroyObject



39
40
41
42
43
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 39

def destroy
  @category.destroy
  flash[:success] = t('workarea.admin.catalog_categories.flash_messages.removed')
  redirect_to catalog_categories_path
end

#editObject



21
22
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 21

def edit
end

#indexObject



10
11
12
13
14
15
16
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 10

def index
  search = Search::AdminCategories.new(
    params.merge(autocomplete: request.xhr?)
  )

  @search = SearchViewModel.new(search, view_model_options)
end

#insightsObject



36
37
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 36

def insights
end

#showObject



18
19
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 18

def show
end

#updateObject



24
25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 24

def update
  set_range_facets
  @category.save

  if @category.update_attributes(params[:category])
    flash[:success] = t('workarea.admin.catalog_categories.flash_messages.saved')
    redirect_to catalog_category_path(@category)
  else
    render :edit, status: :unprocessable_entity
  end
end