Sha256: 27767c039501f63b92d970c47ddd6f44179610f9737844141b1a1960ec9f6171
Contents?: true
Size: 1.01 KB
Versions: 13
Compression:
Stored size: 1.01 KB
Contents
module Neo4j module MetaModel module Meta class HasAssociationsController < ApplicationController before_action :get_has_association, only: [:edit, :show, :update, :destroy] def index render json: HasAssociation.all end def show respond_to do |format| format.json { render json: @has_association } end end def create has_association = HasAssociation.create(has_association_params) create_models render json: has_association end def destroy @has_association.destroy create_models render json: nil end private def get_has_association @has_association = HasAssociation.find(params[:id]) end def has_association_params params.require(:has_association).permit(:join_type, :name, :opposite_name, :relationship_type, :from_model_id, :to_model_id) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems