I have a variable called @class = Book
. Book
being the constant representing the class.
I want to convert it to a string so i can use it in creating instant variable used in the views
In other words, i want the opposite method of constantize
which can take a string and convert it into a class.
Any clues?
Thanks!
You can get name of a class by calling its name
method:
@class.name