D
Dustin Anderson
Hi All,
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[0] %>
...the view returns a numeric value:
91
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"]
irb(main):005:0> @blocks[0]
=> "journal"
irb(main):006:0>
Is there some reason why I can't get the "journal" string out of the
array?
Thanks in advance for your help!
Dustin
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[0] %>
...the view returns a numeric value:
91
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"]
irb(main):005:0> @blocks[0]
=> "journal"
irb(main):006:0>
Is there some reason why I can't get the "journal" string out of the
array?
Thanks in advance for your help!
Dustin