On 9 May 2010 02:17, tom <[email protected]> wrote:
> hi, im having a model called category (polymorohic) and listing it in
> the index-view:
> <table>
>  <tr>
>    <th>Title engl</th>
>  </tr>
>
>  <% @categories.each do |category| %>
>    <tr>
>      <td><%= link_to h(category.title_engl), category %>
>        - #of Subcategories: <%=h category.children.count %>
>        - #of questions in that category :<%=h category.messages.count %
>>
>
>        <% category.children.each  do |cat| %>
>          <%=h cat.title_engl %><br>  //OK
>        <% end %>
>
>        <hr>
>        <% for index in 0 ... 5 %>
>          <%=h  category.children[index].inspect %><br>
>        <% end %>
>
>
>      </td>
>    </tr>
>  <% end %>
> </table>
>
>> as u can see, in the for-loop i want for example show only 5 children
> of that specific children. inspect gives me the correct values, but i
> cant address them. whats the proper way here?

I don't understand "inspect gives me the correct values, but i cant
address them".  If inspect is working what is that is not working?

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to