On Feb 3, 10:57 am, Albert Català <[email protected]> wrote: > Curtis j Schofield wrote in post #979342:> 2011/2/1 Albert Catal > <[email protected]>: > >> super(args) > >> end > >> def error(msg) > > > #also - this may give you an error > > # i remember this as > > msg = %%ERROR#{'-'*5}>#{msg}% > > super > > >> raises an error: [super: no superclass method `error' for > > What I did, exactly is: > class Logger > def initialize(args=nil) > super(args) > end > def error(msg) > super("ERROR------------>"+msg) > end > end > > this is in a file.rb in config/initializers/ > > and raises the error I said >
This fails because the superclass of Logger doesn't have an error method - it's Logger itself that provides it. Either have your class subclass from Logger and set your application to use that logger class, or alias the error method and instead of calling the super call the aliased name (depending on how the class is setup there's also a trick you can play with modules) Fred > -- > Posted viahttp://www.ruby-forum.com/. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

