Hi,
Does anyone how to automatically put sequence number in view?
I have an inquiry form like below. However, the number of questions is more than 70, and they are deleted and/reordered in the future. So, I do not want to hard code the number. I was trying to create variable and increment on each question, but everything are displayed as 1.
I would appreciate if you could tell me any good way to manage this.
Thanks, Glenn
<%= start_form_tag :action => 'update' %> <% Integer @number = 0%> <div class="row"> <strong><%=h @number.next%>.</strong> ID Number: <%=text_field 'person', 'id_number' %> </div>
<div class="row"> <strong><%=h @number.next%>.</strong> Name: <%=text_field 'person', 'name' %> </div>
<div class="row"> <strong><%=h number.next%>.</strong> Email: <%=text_field 'person', 'email' %> </div>
...lots of fields...