esdevs wrote:
> never mind - figured it out - the issue was in the div (and made them
> dynamic through below)...works -- thanks!
> 
> <h3><%= link_to_function post.title, "Element.toggle('#{post.title}')"
> %></h3>
> <div id="<%= post.title %>" style="display: none;">
>   <%= post.link %>
> </div>

Just make sure that <%= post.title %> is unique for the page.

Also note that a cleaner solution (assuming "post" is an ActiveRecord 
subclass) is to use div_for since it will automatically generate a 
unique id for your div representing your post:

http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M002465&name=div_for
-- 
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 [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