Sunday, January 3, 2010

[Rails] Re: Question regarding entering data in a has_many relations

So answering my own question, is this ok or is there a cleaner way to
do it?

<ul>
<% index = 1 %>
<% @recipe.steps.each do |step| %>
<li><%= index %>: <%= step.step %></li>
<% index += 1 %>
<% end %>
</ul>

Thanks a lot.

On Jan 3, 5:10 pm, Ooh_Gravy <shar...@jalloq.co.uk> wrote:
> OK, thanks.  What I wanted to do was this:
>
>         <ul>
>                 <% @recipe.steps.each do |step| %>
>                         <li><%= step.id %>: <%= step.step %></li>
>                 <% end %>
>         </ul>
>

--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate