Class: Phcpresspro::Modules::CategoriesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/phcpresspro/modules/categories_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #new_login_url, #require_user

Instance Method Details

#createObject

Create News/Blog Category



28
29
30
31
32
33
34
35
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 28

def create
	@modules_category = Modules::Category.new(modules_category_params)
	if @modules_category.save
		redirect_to modules_categories_url, notice: 'Category was successfully created.'
		else
			render :new
	end
end

#destroyObject

Delete News/Blog Category



47
48
49
50
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 47

def destroy
	@modules_category.destroy
	redirect_to modules_categories_url, notice: 'Category was successfully destroyed.'
end

#editObject

Edit News/Blog Category



24
25
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 24

def edit
end

#indexObject

Categories Index



10
11
12
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 10

def index
	@modules_categories = Modules::Category.all
end

#newObject

New News/Blog Category



19
20
21
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 19

def new
	@modules_category = Modules::Category.new
end

#showObject

Detail News/Blog Category



15
16
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 15

def show
end

#updateObject

Update News/Blog Category



38
39
40
41
42
43
44
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 38

def update
	if @modules_category.update(modules_category_params)
		redirect_to modules_categories_url, notice: 'Category was successfully updated.'
		else
			render :edit
	end
end