title: Creating a simple array with multiple values in Ruby on Rails
body: <p>Arrays have always been my downfall in every language I've worked with, but I'm in a situation where I really need to create a dynamic array of multiple items in Rails (note - none of these are related to a model).</p>
  
  <p>Briefly, each element of the array should hold 3 values - a word, it's language, and a translation into English. For example, here's what I'd like to do:</p>
  
  <pre><code>myArray = Array.new
  </code></pre>
  
  <p>And then I'd like to push some values to the array (note - the actual content is taken from elsewhere - although not a model - and will need to be added via a loop, rather than hard coded as it is here):</p>
  
  <pre><code>myArray[0] = [["bonjour"], ["French"], ["hello"]]
  
  myArray[1] = [["goddag"], ["Danish"], ["good day"]]
  
  myArray[2] = [["Stuhl"], ["German"], ["chair"]]
  </code></pre>
  
  <p>I would like to create a loop to list each of the items on a single line, something like this:</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;bonjour is French for hello&lt;/li&gt;
  &lt;li&gt;goddag is Danish for good day&lt;/li&gt;
  &lt;li&gt;Stuhl is German for chair&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>However, I'm struggling to (a) work out how to push multiple values to a single array element and (b) how I would loop through and display the results.</p>
  
  <p>Unfortunately, I'm not getting very far at all. I can't seem to work out how to push multiple values to a single array element (what normally happens is that the [] brackets get included in the output, which I obviously don't want - so it's possibly a notation error).</p>
  
  <p>Should I be using a hash instead?</p>
  
  <p>At the moment, I have three separate arrays, which is what I've always done, but I don't particularly like - that is, one array to hold the original word, one array to hold the language, and a final array to hold the translation. While it works, I'm sure this is a better approach - if I could work it out!</p>
  
  <p>Thanks!</p>