Module namespace interpolation in rails type = 'baz' Foo::Bar.const_get(type.capitalize).new # => new instance of Foo::Bar::Baz Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus Previous Next