From: Collin Miller Date: 2007-08-11T03:44:58+09:00 Subject: Re: Unwanted behavior with "define" method an Test::Unit Found this: ----------------- Not sure if this is the most elegant way, but: define_method(:method_name) do |*args| parameter, parameter2 = *args parameter2 ||= 'default' puts parameter puts parameter2 end ----------------- That'll do for now. On Aug 10, 1:23 pm, Collin Miller wrote: > line 7: define_method("create_#{model_name}") { |attrs| > > Line 7 seems to be the problem line. > > I think I want to do this: > define_method("create_#{model_name}") { |attrs={}| > > But I cannot. I can still use the defined method and not send it an > argument, but then Ruby complains.