app/controllers/clients_controller.rb
def destroy
    assert_params_must_have :id
    
    # Do check confirmation
    if params[:name_confirmation] == @client.name
      result = @client.destroy
      if result
	     flash[:notice] = 'Client, his projects and activities have been deleted'
      else 
	     flash[:error] = 'Error occured while deleting client'
      end
    else
      flash[:error] = "The client has not been deleted, since the name was different" 
    end
    redirect_to :action => 'list'
  end
#
# Removes client after confirmation
# If confirmation doesn't match it returns to list action with info in flash
#

Removes client after confirmation
If confirmation doesn't match it returns to list action with info in flash
Removes client after confirmation If confirmation doesn ' t match it returns to list action with info in flash
def destroy
    assert_params_must_have :id
    if params[:name_confirmation] == @client.name
      result = @client.destroy
      if result
	     flash[:notice] = 'Client, his projects and activities have been deleted'
      else 
	     flash[:error] = 'Error occured while deleting client'
      end
    else
      flash[:error] = "The client has not been deleted, since the name was different" 
    end
    redirect_to :action => 'list'
  end
def destroy assert_params_must_have :id if params [ :name_confirmation ] == @client . name result = @client . destroy if result flash [ :notice ] = 'Client, his projects and activities have been deleted' else flash [ :error ] = 'Error occured while deleting client' end else flash [ :error ] = "The client has not been deleted, since the name was different" end redirect_to :action => 'list' end
Removes client after confirmation
If confirmation doesn't match it returns to list action with info in flash
Removes client after confirmation If confirmation doesn ' t match it returns to list action with info in flash
# Do check confirmation
