John Barnette
3/3/2008 10:33:00 PM
On Mon, Mar 3, 2008 at 1:39 AM, Sijo Kg <sijo@maxxion.com> wrote:
> I have an ActiveRecord class ServiceDesk and a string "ServiceDesk"
> .How can I convert the string "ServiceDesk" to create a new object of
> the class ServiceDesk?
Since you're working with Rails and therefore ActiveSupport, you can do:
"ServiceDesk".constantize.new
~ j.