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!
Written by Carlos Hernández
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#