Class: Workarea::Admin::CatalogProductsController
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
#content ⇒ Object
32
33
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 32
def content
end
|
#destroy ⇒ Object
38
39
40
41
42
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 38
def destroy
@product.destroy
flash[:success] = t('workarea.admin.catalog_products.flash_messages.deleted')
redirect_to catalog_products_path
end
|
#details ⇒ Object
49
50
51
52
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 49
def details
@values = Catalog::DetailsQueries.find_details(params[:name], params[:q])
render 'workarea/admin/shared/values'
end
|
#filters ⇒ Object
44
45
46
47
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 44
def filters
@values = Catalog::DetailsQueries.find_filters(params[:name], params[:q])
render 'workarea/admin/shared/values'
end
|
#index ⇒ Object
9
10
11
12
13
14
15
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 9
def index
search = Search::AdminProducts.new(
params.merge(autocomplete: request.xhr?)
)
@search = Admin::SearchViewModel.new(search, view_model_options)
end
|
#insights ⇒ Object
35
36
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 35
def insights
end
|
#show ⇒ Object
17
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 17
def show; end
|
#update ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/workarea/admin/catalog_products_controller.rb', line 19
def update
set_details
set_filters
if @product.update_attributes(params[:product])
flash[:success] = t('workarea.admin.catalog_products.flash_messages.saved')
redirect_to catalog_product_path(@product)
else
flash[:error] = @product.errors.full_messages
render :edit, status: :unprocessable_entity
end
end
|