From: Calamitas Date: 2008-10-03T06:56:23+09:00 Subject: Re: eruby: problem defining a new method for Array ------=_Part_13514_5959348.1222984657987 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thu, Oct 2, 2008 at 11:14 PM, Davi Barbosa > wrote: > Thank you for the answer Peter, but the problem remains. Your suggestion > works on ruby, irb, and eruby if I run directly from the shell, but when > I try to open the page I get an "undefined method" error. > It was a long shot as I've never used mod_ruby so I can't test any fix. Can you try this instead? class Object::Array def to_hash {'test' => 'ing'} end end Nonetheless it's probably better style to put any definitions in a separate Ruby file and requiring it from the rhtml file. Peter ------=_Part_13514_5959348.1222984657987--