Class: ActiveStix::RelationshipsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- ActiveStix::RelationshipsController
- Defined in:
- app/controllers/active_stix/relationships_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /relationships.
-
#destroy ⇒ Object
DELETE /relationships/1.
-
#edit ⇒ Object
GET /relationships/1/edit.
-
#index ⇒ Object
GET /relationships.
-
#new ⇒ Object
GET /relationships/new.
-
#show ⇒ Object
GET /relationships/1.
-
#update ⇒ Object
PATCH/PUT /relationships/1.
Instance Method Details
#create ⇒ Object
POST /relationships
26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 26 def create @relationship = Relationship.new(relationship_params) if @relationship.save redirect_to @relationship, notice: 'Relationship was successfully created.' else render :new end end |
#destroy ⇒ Object
DELETE /relationships/1
46 47 48 49 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 46 def destroy @relationship.destroy redirect_to relationships_url, notice: 'Relationship was successfully destroyed.' end |
#edit ⇒ Object
GET /relationships/1/edit
22 23 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 22 def edit end |
#index ⇒ Object
GET /relationships
8 9 10 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 8 def index @relationships = Relationship.all end |
#new ⇒ Object
GET /relationships/new
17 18 19 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 17 def new @relationship = Relationship.new end |
#show ⇒ Object
GET /relationships/1
13 14 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 13 def show end |
#update ⇒ Object
PATCH/PUT /relationships/1
37 38 39 40 41 42 43 |
# File 'app/controllers/active_stix/relationships_controller.rb', line 37 def update if @relationship.update(relationship_params) redirect_to @relationship, notice: 'Relationship was successfully updated.' else render :edit end end |