Theoretical question on why this code doesnt work


I know this code makes no sense (that im randomly testing), but im just trying to understand how ruby works. I do not understand why title to_sym = rating.to_i doesn't work. Any help or enlightenment is greatly appreciated.

Error message as follows

undefined method `to_sym=' for "dog":String

title = "dog"

rating = "3"

title.to_sym = rating.to_i


What are you trying to do?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.