Last Updated: February 25, 2016
·
584
· polimorfico

Get class name from string

Sometime you need to convert a simple string into a class name...

x = 'invoices'
# => 'invoices'
x.classify.constantize
# => Invoice

Happy coding!