Class: Protege::ResponsibilitiesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Protege::ResponsibilitiesController
- Defined in:
- app/controllers/protege/responsibilities_controller.rb
Overview
Manages scheduled responsibilities — the Loop layer's dashboard CRUD. A top-level section (like Personas or Traces): responsibilities are listed across all personas, and each one names its owning persona in the form rather than carrying it in the URL.
Instance Method Summary collapse
-
#create ⇒ void
Create a responsibility (its persona is chosen in the form).
-
#destroy ⇒ void
Remove a responsibility.
-
#edit ⇒ void
Render the form for editing a responsibility.
-
#index ⇒ void
List every responsibility, newest-owner-agnostic (ordered by name via the model's default scope).
-
#new ⇒ void
Render the form for creating a responsibility.
-
#show ⇒ void
Show a single responsibility and its recent runs.
-
#update ⇒ void
Update a responsibility.
Instance Method Details
#create ⇒ void
This method returns an undefined value.
Create a responsibility (its persona is chosen in the form). On failure, re-render with errors.
37 38 39 40 41 42 43 44 45 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 37 def create @responsibility = Responsibility.new(responsibility_params) if @responsibility.save redirect_to responsibility_path(@responsibility), notice: 'Responsibility created.' else render :new, status: :unprocessable_entity end end |
#destroy ⇒ void
This method returns an undefined value.
Remove a responsibility.
61 62 63 64 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 61 def destroy @responsibility.destroy redirect_to responsibilities_path, notice: 'Responsibility deleted.' end |
#edit ⇒ void
This method returns an undefined value.
Render the form for editing a responsibility.
32 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 32 def edit; end |
#index ⇒ void
This method returns an undefined value.
List every responsibility, newest-owner-agnostic (ordered by name via the model's default scope).
13 14 15 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 13 def index @responsibilities = Responsibility.includes(:persona) end |
#new ⇒ void
This method returns an undefined value.
Render the form for creating a responsibility.
25 26 27 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 25 def new @responsibility = Responsibility.new end |
#show ⇒ void
This method returns an undefined value.
Show a single responsibility and its recent runs.
20 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 20 def show; end |
#update ⇒ void
This method returns an undefined value.
Update a responsibility. On failure, re-render the edit form with validation errors.
50 51 52 53 54 55 56 |
# File 'app/controllers/protege/responsibilities_controller.rb', line 50 def update if @responsibility.update(responsibility_params) redirect_to responsibility_path(@responsibility), notice: 'Responsibility updated.' else render :edit, status: :unprocessable_entity end end |