Multiple toggle divs

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

just replace

with

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs