Skip to content

Instantly share code, notes, and snippets.

@richardsondx
Created April 27, 2012 17:55
Show Gist options
  • Save richardsondx/2511266 to your computer and use it in GitHub Desktop.
Save richardsondx/2511266 to your computer and use it in GitHub Desktop.
This is what I've done
<% for micropost in @microposts %>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".slidingDiv<%= micropost.id %>").hide();
$(".show_hide<%= micropost.id %>").show();
$('.show_hide<%= micropost.id %>').click(function(){
$(".slidingDiv<%= micropost.id %>").slideToggle();
});
});
</script>
<%= link_to image_tag('Comment.png', :mouseover => "Comment-Over.png", :class => "show_hide"), "#" %>
<div class="slidingDiv<%= micropost.id %>">
<%= render :partial => 'microposts/display', :locals => { :micropost => @micropost } %>
<a href="#" class="show_hide<%= micropost.id %>">hide</a>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment