core/rails/app/controllers/nodes_controller.rb
# RESTful DELETE of the node resource
RESTful DELETE of the node resource
RESTful DELETE of the node resource
def destroy
    if params[:group_id]
      model.transaction do
        @node = find_key_cap(model, params[:id] || params[:name], cap("READ"))
        @group = find_key_cap(Group, params[:group_id], cap("DESTROY", "GROUP"))
        @group.nodes.delete(@node) if @group.nodes.include?(@node)
      end
      respond_to do |format|
        format.html { render :text=>I18n.t('api.removed', :item=>'node', :collection=>'group') }
        format.json { render api_delete @node }
      end
      return
    end
    model.transaction do
      @node = find_key_cap(model,params[:id] || params[:name], cap("DESTROY"))
      @node.destroy
    end
    respond_to do |format|
      format.html { redirect_to deployment_path(@node.deployment_id) }
      format.json { render api_delete @node }
    end
  end
def destroy if params [ :group_id ] model . transaction do @node = find_key_cap ( model , params [ :id ] || params [ :name ] , cap ( "READ" ) ) @group = find_key_cap ( Group , params [ :group_id ] , cap ( "DESTROY" , "GROUP" ) ) @group . nodes . delete ( @node ) if @group . nodes . include? ( @node ) end respond_to do | format | format . html { render :text => I18n . t ( 'api.removed' , :item => 'node' , :collection => 'group' ) } format . json { render api_delete @node } end return end model . transaction do @node = find_key_cap ( model , params [ :id ] || params [ :name ] , cap ( "DESTROY" ) ) @node . destroy end respond_to do | format | format . html { redirect_to deployment_path ( @node . deployment_id ) } format . json { render api_delete @node } end end
RESTful DELETE of the node resource
RESTful DELETE of the node resource
# Arguably, these should both be UPDATE