Forum: Ruby on Rails Polymorphic helper methods?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
michael (Guest)
on 2005-11-14 22:14
(Received via mailing list)
I need a *general* helper method for displaying some of my model
classes. What is displayed depends on the model. How it is displayed
depends on the locale.

The first requirement can be met by defining an appropriate
#to_formatted_s method in each of the relevant model classes. The
second requirement can be met by a couple of locale-aware helper
methods. Unfortunately, I don't see how to get these two requirements
together. Ideally, I'd even like to get rid of #to_formatted_s as it is
only about presentation and thus doesn't belong in the model.

Therefore, what I need are polymorphic helper methods. But how do I get


Michael S.                  Airtight arguments have
mailto:removed_email_address@domain.invalid        vacuous conclusions.   --A.O. Rorty, Explaining Emotions
This topic is locked and can not be replied to.