javascript - How to make the comments appear in the popup in Rails 3? -


update

i have popup working, i'm having issues code. how can display comments associated post in popup? please refer below code have view.

i decided using popups easiest way solve current formatting issues. basically, have "comments" under each post. instead of having them show below post, i'd have them come in popup when link "x comments" clicked. reason that, can't formatting correct when try have them appear underneath.

here's link have # of comments in view clicked popup

<a href="#" id="comment_count"><%= micropost.comments.count.to_s %> comment </a> 

i'll implement pluralizing of text later.

this code comments associated each post.

<div class ="itemcomments"><% if post.comments.exists? %>     <% post.comments.each |comment| %>     <%= image_tag("http://www.gravatar.com/avatar.php?gravatar_id=#{digest::md5::hexdigest(comment.user.email)}") %> <!-- retrieves gravatar -->      <%= link_to comment.user.name, comment.user %>             <span class="timestamp"><%= time_ago_in_words(comment.created_at) %> ago</span>     <span class="content2"><%= comment.comment_content %></span>     <% end %></div> 

the above view rendered _post.html.erb it's shown

 <%= render 'shared/comment_form', post: post %>  

how can have associated "comments" pop when link clicked under each post?


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -