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'')" %>
<div id="paragraph#{n}" style= "display:none">
some paragaraph.
</div>
<% 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
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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'')" %>
<div id="paragraph#{n}" style= "display:none">
some paragaraph.
</div>
<% 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
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Mon, Apr 28, 2008 at 3:40 PM, rushnosh <rashantha-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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'')" %> > <div id="paragraph#{n}" style= "display:none">The #{stuff} syntax only works between <% and %> so replace it there.> <div id="paragraph<%= n %>" style= "display:none">> some paragaraph. > </div> > <% 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 > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
just replace> <div id="paragraph#{n}" style= "display:none">with <div id="paragraph<%= n %>" style= "display:none"> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---