Created
July 1, 2009 03:29
-
-
Save jedediah/138568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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