you can check for nil of course...
eg:
<%= @absent.person.name if @absent.person %>
But that is weak db/model design.
-Either don''t allow deletion of persons and use an is_active flag
instead,
(most likely the best way to handle this)
- or make sure that if you delete a person all related records get
deleted too.
You can do this manually in the destroy action of the
PersonsController
or by using :dependent => destroy for all the associations.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---