# Multiple toggle divs

**URL:** <https://www.ruby-forum.com/t/multiple-toggle-divs/136108>\
**Category:** Rails\
**Created:** [April 28, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/multiple-toggle-divs/136108 "2008-04-28T23:32:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rushnosh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58956e/32.png) [@rushnosh](https://www.ruby-forum.com/u/rushnosh)\
**Post date:** [April 28, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/multiple-toggle-divs/136108/1 "2008-04-28T23:32:28Z")

</div>

i have a list of items i need to display with a corresponding  
paragraph for each item that i want to hid in a div in a view.

\<% @items.each\_with\_index do | item, n | %\>  
\<%= link\_to\_function “highlights”,  
“Element.toggle(‘paragraph#{n}’, ‘true’)” %\>

 some paragaraph. 
\<% end %\>

this is not working because i am not seeing how to get n (index value)  
into the div.  
also there might be an easier way to do this.

i have to have multiple div in my css for this to work

---

<div class="post-metadata">

**Author:** ![rushnosh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58956e/32.png) [@rushnosh](https://www.ruby-forum.com/u/rushnosh)\
**Post date:** [April 29, 2008, 10:29am UTC](https://www.ruby-forum.com/t/multiple-toggle-divs/136108/2 "2008-04-29T10:29:02Z")

</div>

just replace

> with
