Class: Phcmemberspro::Directory::CategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/phcmemberspro/directory/categories_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_account, #scoped_to

Instance Method Details

#createObject

Create Action



30
31
32
33
34
35
36
37
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 30

def create
	@directory_category = Directory::Category.scoped_to().new(directory_category_params)
	if @directory_category.save
		redirect_to directory_categories_path, notice: 'Category was successfully created.'
		else
			render :new
	end
end

#destroyObject

Delete Action



49
50
51
52
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 49

def destroy
	@directory_category.destroy
	redirect_to directory_categories_path, notice: 'Category was successfully destroyed.'
end

#editObject

Edit Directory Category



26
27
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 26

def edit
end

#indexObject

Directory Category Index



12
13
14
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 12

def index
	@directory_categories = Directory::Category.scoped_to().order('catname ASC')
end

#newObject

New Directory Category



21
22
23
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 21

def new
	@directory_category = Directory::Category.scoped_to().new
end

#showObject

Directory Category Details



17
18
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 17

def show
end

#updateObject

Update Action



40
41
42
43
44
45
46
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 40

def update
	if @directory_category.update(directory_category_params)
		redirect_to directory_categories_path, notice: 'Category was successfully updated.'
		else
			render :edit
	end
end