Class: Phcmemberspro::Directory::CategoriesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Phcmemberspro::Directory::CategoriesController
- Defined in:
- app/controllers/phcmemberspro/directory/categories_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create Action.
-
#destroy ⇒ Object
Delete Action.
-
#edit ⇒ Object
Edit Directory Category.
-
#index ⇒ Object
Directory Category Index.
-
#new ⇒ Object
New Directory Category.
-
#show ⇒ Object
Directory Category Details.
-
#update ⇒ Object
Update Action.
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
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(current_account).new(directory_category_params) if @directory_category.save redirect_to directory_categories_path, notice: 'Category was successfully created.' else render :new end end |
#destroy ⇒ Object
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 |
#edit ⇒ Object
Edit Directory Category
26 27 |
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 26 def edit end |
#index ⇒ Object
Directory Category Index
12 13 14 |
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 12 def index @directory_categories = Directory::Category.scoped_to(current_account).order('catname ASC') end |
#new ⇒ Object
New Directory Category
21 22 23 |
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 21 def new @directory_category = Directory::Category.scoped_to(current_account).new end |
#show ⇒ Object
Directory Category Details
17 18 |
# File 'app/controllers/phcmemberspro/directory/categories_controller.rb', line 17 def show end |
#update ⇒ Object
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 |