Class: Portfolio::Admin::SiteItemCategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/portfolio/admin/site_item_categories_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 19

def create
  @categ = SiteItemCategory.new(admin_site_item_category_params)

  if @categ.save
    redirect_to admin_site_item_categories_path,
      notice: 'Site item category was successfully created.'
  else
    render :new
  end
end

#destroyObject



39
40
41
42
43
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 39

def destroy
  @categ.destroy
  redirect_to admin_site_item_categories_path,
    notice: 'Site item category was successfully destroyed.'
end

#editObject



16
17
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 16

def edit
end

#indexObject



8
9
10
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 8

def index
  @categories = SiteItemCategory.all
end

#newObject



12
13
14
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 12

def new
  @categ = SiteItemCategory.new
end

#updateObject



30
31
32
33
34
35
36
37
# File 'app/controllers/portfolio/admin/site_item_categories_controller.rb', line 30

def update
  if @categ.update(admin_site_item_category_params)
    redirect_to admin_site_item_categories_path,
      notice: 'Site item category was successfully updated.'
  else
    render :edit
  end
end