Class: HelpCenter::SupportCategoriesController
Instance Method Summary
collapse
#is_moderator?, #is_moderator_or_owner?, #page_number, #require_mod_or_author_for_post!, #require_mod_or_author_for_thread!
Instance Method Details
#create ⇒ Object
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 17
def create
@category = SupportCategory.new(support_category_params)
if @category.save
redirect_to help_center.support_threads_path
else
render action: :new
end
end
|
#destroy ⇒ Object
38
39
40
41
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 38
def destroy
@category.destroy
redirect_to help_center.support_threads_path, notice: I18n.t('successfully_deleted')
end
|
#edit ⇒ Object
27
28
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 27
def edit
end
|
#index ⇒ Object
7
8
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 7
def index
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 10
def new
@category = SupportCategory.new
end
|
#show ⇒ Object
14
15
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 14
def show
end
|
#update ⇒ Object
30
31
32
33
34
35
36
|
# File 'app/controllers/help_center/support_categories_controller.rb', line 30
def update
if @category.update(support_category_params)
redirect_to help_center.support_category_path(@category), notice: I18n.t('your_changes_were_saved')
else
render action: :edit
end
end
|