Class: Neo4j::MetaModel::Meta::HasAssociationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/neo4j/meta_model/meta/has_associations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
23
# File 'app/controllers/neo4j/meta_model/meta/has_associations_controller.rb', line 17

def create
  has_association = HasAssociation.create(has_association_params)

  create_models

  render json: has_association
end

#destroyObject



25
26
27
28
29
30
31
# File 'app/controllers/neo4j/meta_model/meta/has_associations_controller.rb', line 25

def destroy
  @has_association.destroy

  create_models

  render json: nil
end

#indexObject



7
8
9
# File 'app/controllers/neo4j/meta_model/meta/has_associations_controller.rb', line 7

def index
  render json: HasAssociation.all
end

#showObject



11
12
13
14
15
# File 'app/controllers/neo4j/meta_model/meta/has_associations_controller.rb', line 11

def show
  respond_to do |format|
    format.json { render json: @has_association }
  end
end