Class: Radesk::Admin::CategoriesController
Instance Method Summary
collapse
#radesk_authorize!, #radesk_authorize_admin!, #radesk_check_access, #radesk_current_user
Instance Method Details
#create ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 19
def create
@category = Category.new(category_params)
if @category.save
redirect_to admin_categories_path, notice: 'Category was successfully created.'
else
redirect_to admin_categories_path
end
end
|
#destroy ⇒ Object
40
41
42
43
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 40
def destroy
@category.destroy
redirect_to admin_categories_path, notice: 'Category was successfully destroyed.'
end
|
#edit ⇒ Object
29
30
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 29
def edit
end
|
#index ⇒ Object
8
9
10
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 8
def index
@categories = Category.all
end
|
#new ⇒ Object
15
16
17
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 15
def new
@category = Category.new
end
|
#show ⇒ Object
12
13
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 12
def show
end
|
#update ⇒ Object
32
33
34
35
36
37
38
|
# File 'app/controllers/radesk/admin/categories_controller.rb', line 32
def update
if @category.update(category_params)
redirect_to admin_categories_path, notice: 'Category was successfully updated.'
else
render :edit
end
end
|