Forum: Ruby on Rails Polymorphic helper methods?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bce1d1b7c3ec7b577dcb42e254899e6b?d=identicon&s=25 michael (Guest)
on 2005-11-14 21: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
them?

Michael

--
Michael Schuerig                  Airtight arguments have
mailto:michael@schuerig.de        vacuous conclusions.
http://www.schuerig.de/michael/   --A.O. Rorty, Explaining Emotions
This topic is locked and can not be replied to.