I have a string, which has been created at runtime. I want to use this string as a variable to store some data into it. How can I convert the string into a variable name?
Now simply using instance_variable_set method, you can create a instance variable at runtime.
instance_variable_set('@' + 'users', User.all)