Hi, I've a model called "Invoice" that :has_many products.
I've validate the destroy of one Invoice that control if the
invoice.products is empty (one invoice can't be deleted if contains
products).
Here the code:
-----------------------------------
before_destroy :deletable
def deletable
unless products == []
raise "You can't destroy this invoice!"
end
end
-------------------------------------
The validation is ok so in the view (managed by ActiveScaffold) if I
try to delete one invoice with some products associated, I receive the
message "Request Failed (code 500, Internal Error)" and not "You can't
destroy this invoice!".
How can I change the message?
Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---