I want to create an instance variable in a controller to be used in the view:
foo = "bar"
instance_variable_set("#{foo}", "cornholio")
In the view, use @bar so that:
@bar => "cornholio"
This generates an error: 'bar' is not allowed as an instance variable name
Working in Rails 3.1
@
if it didn't exist. – Enterotomy