From: Gabriele Marrone Date: 2006-11-05T00:45:26+09:00 Subject: Re: Add dynamic instance methods in a controller class Il giorno 04/nov/06, alle ore 16:03, Luc Juggery ha scritto: > # THIS PART IS NOT WORKING > @main_sections.each do |section| > self.instance_eval{ define_method("get_item_for_#{section}") > {"toto"}} > end I suggest something like: @main_sections.each do |section| eval %Q( def get_item_for_#{section} "toto" end ) end I didn't try it but I think it should work.