How to create a variable name from the value of a string in Ruby on Rails?
This instance_variable_set("#{foo}", "cornholio")
needs to read instance_variable_set("@#{foo}", "cornholio")
Based on this post. Just tried it in my irb for Ruby 1.93; the post is from 2009.
In Ruby, instance variable names always have to start with an @
sigil.