Class: Phcpresspro::Modules::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcpresspro::Modules::CategoriesController
- Defined in:
- app/controllers/phcpresspro/modules/categories_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create News/Blog Category.
-
#destroy ⇒ Object
Delete News/Blog Category.
-
#edit ⇒ Object
Edit News/Blog Category.
-
#index ⇒ Object
Categories Index.
-
#new ⇒ Object
New News/Blog Category.
-
#show ⇒ Object
Detail News/Blog Category.
-
#update ⇒ Object
Update News/Blog Category.
Methods inherited from ApplicationController
#current_user, #new_login_url, #require_user
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
Edit News/Blog Category
24 25 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 24 def edit end |
#index ⇒ Object
Categories Index
10 11 12 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 10 def index @modules_categories = Modules::Category.all end |
#new ⇒ Object
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 |
#show ⇒ Object
Detail News/Blog Category
15 16 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 15 def show end |
#update ⇒ Object
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 |