Greg Hauptmann wrote:
Can anyone recommend how to override a mixin method but then call the overridden method within this??? (e.g. like calling "super")
Specifically I would like to provide an overridden "link_to" method to my views which would add a params[:locale] parameter to the mix and THEN call the original/rails "link_to" method after this. Like a "super" type call.
Any suggestions on how to do this sort of overridding/overloading with mixin methods?
To have access to the original link_to as link_to_orig, put this in your helper module:
def self.append_features(base) base.class_eval 'alias :link_to_orig :link_to' super end