robzdc
March 15, 2013, 10:43pm
1
Hi, I have an issue with a variable creating an array…
First, I initialize the array.
@data = []
Then I add the data.
@data << [...]
Then I display the results
<% @data.each do |data| %>
It works great… but if I change the variable name to @x it fails and display an empty array…
I dont understand why.
Any help please?
robzdc
March 15, 2013, 11:08pm
2
Done.
I had to restart the server…
The weird thing is that Im in development environment…
You should only need to restart the server if the code is an an initialiser that’s run when Rails is booted.
Any regular code in the /app directory will get run every time a page is loaded.
robzdc
March 16, 2013, 10:31pm
4
ohh, thanks, thats why then…
Im creating my functions in /lib