Skip to content

Instantly share code, notes, and snippets.

@jedediah
Created July 1, 2009 03:29
Show Gist options
  • Save jedediah/138568 to your computer and use it in GitHub Desktop.
Save jedediah/138568 to your computer and use it in GitHub Desktop.
def delete
text = "Enter the name of the record you want to delete"
loop do
action, record = input :text => text,
:buttons => {:delete => "Delete", :cancel => "Cancel"}
break if action == :cancel
if record_exist? record
delete_record record if dialog :text => "Really delete #{record}?",
:buttons => {true => "Yes", false => "No"}
alert :text => "Record deleted"
break
else
text = "Record not found, please try again"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment