Ruby on Rails Discussions
variable variable
rubyonrails-talk
Chris_Hall
(Chris Hall)
February 28, 2007, 1:25pm
1
x = 'MyModel' obj = Module.const_get(x).new obj.class => MyModel
Related topics
Topic
Replies
Views
Activity
variable variable
rubyonrails-talk
0
105
March 1, 2007
Find when you have the model name but not the class
rubyonrails-talk
0
120
November 10, 2006
Models inheritance
rubyonrails-talk
0
105
September 26, 2006
Active Record From A String
rubyonrails-talk
0
123
December 22, 2006
AR Models in Module
rubyonrails-talk
1
154
July 14, 2008