I'm coming from a .net c# razor background, so I'm wondering how I might do the following in rails .erb view.
Razor:
@{var i = 0}
<table>
<tr><th>name</th></tr>
@foreach item in collection{
<tr>
<td>@[email protected]</td>
</tr>
}
</table>
I want a way to use an iteration variable in the view. Does a rails erb file have the ability to do this? where I can create the variable in the view and interact with it?
thanks in advance.