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

On Mon, Apr 28, 2008 at 3:40 PM, rushnosh [email protected] wrote:

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’)” %>

The #{stuff} syntax only works between <% and %>
so replace it there.

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