def destroy
      @image = Cmtool::Image.find(params[:id])
      directory = @image.directory
      @image.destroy

      respond_to do |format|
        format.html { redirect_to([cmtool, directory || :images]) }
        format.xml  { head :ok }
      end
    end
def destroy
      @image = Cmtool::Image.find(params[:id])
      directory = @image.directory
      @image.destroy

      respond_to do |format|
        format.html { redirect_to([cmtool, directory || :images]) }
        format.xml  { head :ok }
      end
    end
DELETE /images/1
 DELETE /images/1.xml