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



42
43
44
45
46
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 42

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

#editObject



24
25
# File 'app/controllers/workarea/admin/catalog_categories_controller.rb', line 24

def edit
end

#indexObject



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

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

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

#insightsObject



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

def insights
end

#showObject



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

def show
end

#updateObject



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

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