On Sunday 31 January 2010, Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
> > On Sunday 31 January 2010, Marnen Laibow-Koser wrote:
> >> Michael Schuerig wrote:
> >> [...]
> >>
> >> > Helpers are procedural by nature. helper :all drives out the
> >> > last bit of polymorphism there was.
> >>
> >> Why do you say that?  I don't understand, except to the extent
> >> that Rails views are sort of procedural.
> >
> > If you only include specific helper modules, you can have multiple
> > methods with the same name, but different implementations. This can
> > be useful in order to avoid inadvertently stepping on another
> > method with the same name in an overcrowded helper namespace.
> 
> Of course.  No argument there.  I just don't understand your
> "procedural" claim.

Well, helper methods *are* procedural. Only by judiciously including 
helper modules you can manually achieve the illusion of polymorphism 
(one method name, multiple implementations).

> > More interestingly,
> > you can have generically named helper methods with implementations
> > appropriate for different model classes.
> 
> But then wouldn't those be better as model methods, not helper
>  methods?

Formatting (e.g.) doesn't belong in the model, does it?

Michael

-- 
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to