C
cedric.ch
Hi,
I would to know if it is possible to do something like that:
def create_object(class_name)
my_object = **class_name**.new
end
I tried with class.new(&class_name)
Class_name = Class.new(&class_name)
my_object = Class_name.New
In fact I have a single table inheritence ( yes, I'm doing a Rails app
). According to the action the user selects , I want to create the
apropriated object.
My English is very bad but I'll be very happy if you could help me.
Thanks
I would to know if it is possible to do something like that:
def create_object(class_name)
my_object = **class_name**.new
end
I tried with class.new(&class_name)
Class_name = Class.new(&class_name)
my_object = Class_name.New
In fact I have a single table inheritence ( yes, I'm doing a Rails app
). According to the action the user selects , I want to create the
apropriated object.
My English is very bad but I'll be very happy if you could help me.
Thanks