From: Cere Davis Date: 2004-07-13T07:32:24+09:00 Subject: Re: can't override a cgi function, please help Oops. I spoke a little too soon. I do get something: An undefined method error on checkbox. So I need to define this method as public or something? How would I overrride a checkbox instance without calling having to call a new CGI class? Ideally, I would just like it to be overriden in the main CGI class and inherited in when I make a CGI.new. Thanks, cere Cere Davis wrote: > That was actually the first thing I tried but I figured I would just > trial and error my way through soem Ruby syntax and class << CGI was my > next guess. Thanks for clarifying the difference. As it happens > though, this makes no difference. Again, I think this may have > something to do with the input(attributes) function at the bottom of the > original cgi class. Something about these variables get precidence > over any overriding variables??? > > Me no understand... > >> >> You're creating/overriding a *class* method of CGI, not an *instance* >> method. Try -- with the code above -- calling 'CGI.checkbox(...)' and >> see what happens. >> >> Do this: >> >> class CGI >> def checkbox(...) >> ... >> end >> end >> >> Cheers, >> Gavin >> >> >>