Saturday, June 20, 2009

Simple Restriction while deleting a record in rails

Adding validations to rails application is really simple and we also get help from rails api.
We can also delete the dependent with a record.

But what if we don't want to delete a record when we have dependent.
I got this solution from the post of Sachin.
Just took dependent and if there is no dependent only then delete this record.

Simple and quick solution. Thanks Sachin.

No comments:

Post a Comment