Good Point. Perhaps:

id = "#{class_name}_#{(ref.respond_to?(:to_param) ? ref.to_param : ref.id )
|| 'new' }"

this is what I originally had before I remembered AR automatically defined
#to_param for you.

Also: irb tells me that "warning: Object#id will be deprecated; use
Object#object_id" when I use this on a non-AR object, so perhaps relying on
#id for non-AR objects. #object_id will always return something, so using
that as a fallback may not be a good idea.

-mattly

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" 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/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to