Class: PolicyManager::TermsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PolicyManager::TermsController
- Defined in:
- app/controllers/policy_manager/terms_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /terms.
-
#destroy ⇒ Object
DELETE /terms/1.
-
#edit ⇒ Object
GET /terms/1/edit.
-
#new ⇒ Object
GET /terms/new.
-
#show ⇒ Object
GET /terms/1.
-
#update ⇒ Object
PATCH/PUT /terms/1.
Methods inherited from ApplicationController
#admin_user, #allow_admins, #current_user, #doc, #set_language, #user_authenticated?
Instance Method Details
#create ⇒ Object
POST /terms
22 23 24 25 26 27 28 29 30 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 22 def create @term = Term.new(term_params) if @term.save redirect_to category_term_path(@term.rule.name, @term), notice: I18n.t("terms_app.terms.new.created") else render :new end end |
#destroy ⇒ Object
DELETE /terms/1
42 43 44 45 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 42 def destroy @term.destroy redirect_to category_terms_path(@term.rule.name), notice: I18n.t("terms_app.terms.new.destroyed") end |
#edit ⇒ Object
GET /terms/1/edit
18 19 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 18 def edit end |
#new ⇒ Object
GET /terms/new
13 14 15 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 13 def new @term = Term.new end |
#show ⇒ Object
GET /terms/1
9 10 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 9 def show end |
#update ⇒ Object
PATCH/PUT /terms/1
33 34 35 36 37 38 39 |
# File 'app/controllers/policy_manager/terms_controller.rb', line 33 def update if @term.update(term_params) redirect_to category_term_path(@term.rule.name, @term), notice: I18n.t("terms_app.terms.new.updated") else render :edit end end |