Why is the name of your variable starting with ‘$’?
Names starting with ‘$’ are reserved for environment variables. I’m
not sure about ‘$x’ but you better follow ruby and rails guidelines
for naming variables or you may be asking for trouble.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.