I’m trying to iterate through an array and pull each value into a view
on my Rails app. The array is stored in a MySQL database.
The array is in a varchar (string) column named “blocks” with the value:
[“journal”, “about”, “news”]
I’m trying to pull each value out one at a time.
If I try to access the array with something like this…:
<%= @blocks %>
…the view returns a numeric value:
I’m totally confused as to why I can’t extract the values out of the
array. It works fine in IRB:
irb(main):004:0> @blocks = [“journal”, “about”]
=> [“journal”, “about”]
Is there some reason why I can’t get the “journal” string out of the
Thanks in advance for your help!