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
POST.
-
#destroy ⇒ Object
DELETE.
-
#edit ⇒ Object
Categories Edit.
-
#index ⇒ Object
Categories Index.
-
#new ⇒ Object
Categories New.
-
#show ⇒ Object
Categories Show.
-
#update ⇒ Object
PATCH/PUT.
Methods inherited from ApplicationController
#current_user, #membership_info, #new_login_url, #require_user
Instance Method Details
#create ⇒ Object
POST
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 31 def create @modules_category = Modules::Category.new(modules_category_params) @modules_category.user_id = current_user.id @modules_category.user_name = current_user.username @modules_category.membership_id = membership_info.id @modules_category.oganization_id = membership_info.org_id if @modules_category.save redirect_to modules_categories_url, notice: 'Category was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE
58 59 60 61 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 58 def destroy @modules_category.destroy redirect_to modules_categories_url, notice: 'Category was successfully destroyed.' end |
#edit ⇒ Object
Categories Edit
27 28 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 27 def edit end |
#index ⇒ Object
Categories Index
13 14 15 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 13 def index @modules_categories = Modules::Category.all end |
#new ⇒ Object
Categories New
22 23 24 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 22 def new @modules_category = Modules::Category.new end |
#show ⇒ Object
Categories Show
18 19 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 18 def show end |
#update ⇒ Object
PATCH/PUT
45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/phcpresspro/modules/categories_controller.rb', line 45 def update @modules_category.user_id = current_user.id @modules_category.user_name = current_user.username @modules_category.membership_id = membership_info.id @modules_category.oganization_id = membership_info.org_id if @modules_category.update(modules_category_params) redirect_to modules_categories_url, notice: 'Category was successfully updated.' else render :edit end end |