Class: Workarea::Admin::CreateCatalogCategoriesController
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
52
53
54
55
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 52
def content
model = Content.for(@category.model)
@content = ContentViewModel.new(model, view_model_options)
end
|
#create ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 18
def create
@category.attributes = params[:category]
if @category.save
flash[:success] = t('workarea.admin.create_catalog_categories.flash_messages.saved')
redirect_to products_create_catalog_category_path(@category)
else
render :setup, status: :unprocessable_entity
end
end
|
#edit ⇒ Object
29
30
31
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 29
def edit
render :setup
end
|
#edit_rule ⇒ Object
48
49
50
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 48
def edit_rule
render :rules
end
|
#featured_products ⇒ Object
36
37
38
39
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 36
def featured_products
search = Search::AdminProducts.new(view_model_options)
@search = SearchViewModel.new(search, view_model_options)
end
|
#index ⇒ Object
14
15
16
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 14
def index
render :setup
end
|
#navigation ⇒ Object
72
73
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 72
def navigation
end
|
#new_rule ⇒ Object
44
45
46
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 44
def new_rule
render :rules
end
|
#products ⇒ Object
33
34
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 33
def products
end
|
#publish ⇒ Object
84
85
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 84
def publish
end
|
#rules ⇒ Object
41
42
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 41
def rules
end
|
#save_navigation ⇒ Object
75
76
77
78
79
80
81
82
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 75
def save_navigation
if params[:create_menu].to_s =~ /true/
Navigation::.create!(taxon: @category.taxon)
flash[:success] = t('workarea.admin.create_catalog_categories.flash_messages.saved')
end
redirect_to publish_create_catalog_category_path(@category)
end
|
#save_publish ⇒ Object
87
88
89
90
91
92
93
94
95
96
97
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 87
def save_publish
publish = SavePublishing.new(@category, params)
if publish.perform
flash[:success] = t('workarea.admin.create_catalog_categories.flash_messages.created')
redirect_to catalog_category_path(@category)
else
flash[:error] = publish.errors.full_messages
render :publish
end
end
|
#save_taxonomy ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 60
def save_taxonomy
save = SaveTaxonomy.new(@taxon, params)
save.perform
flash[:success] = t('workarea.admin.create_catalog_categories.flash_messages.saved')
if save.top_level?
redirect_to navigation_create_catalog_category_path(@category)
else
redirect_to publish_create_catalog_category_path(@category)
end
end
|
#taxonomy ⇒ Object
57
58
|
# File 'app/controllers/workarea/admin/create_catalog_categories_controller.rb', line 57
def taxonomy
end
|