I am new to ruby on rails and doing a small application as I am
learning ruby on rails..
..... and be able to access the array in it...
I have an array of (language_name,language_id) pairs in variable
Eg: [ ( English, 1 ) , ( French, 2 ) , ( German, 3 ) ] ...
I am displaying every language as a row in a table
dynamically add a new row with language_name select box
languages described above ie array of (lang_name, id ) pair which is
used to fill the select options...[ this is working fine given my
parameter is proper ]
But I cant call the script as
so i tried ...
<% for i in 1..@all_languages.length %>
list_of_langs[<%= i-1 %>] = <%=@all_languages[i-1]%>
list_of_langs[<%=i-1%>] = <%=@all_languages[i-1]%>
I am getting syntax error ..
I am sure ruby will have some cool way of doing this .. as with habtm
can anyone help me here...