当我单击链接删除评论时,我会收到两个对话框确认。当我删除确认时,我没有得到任何确认。
查看/评论/_comment:
<span class="comment_info">
<aside class="span2">
<%= link_to gravatar_for((comment.user), size: 35), comment.user %>
<%= link_to comment.user.name, comment.user, id: "feedusername" %>
</aside>
<span id="comment_contentz"> <%= comment.content %>
<span id="timestamp_and_delete">
Said <%= time_ago_in_words(comment.created_at) %> ago.
<% if current_user?(comment.user) || current_user.id == (comment.micropost.user_id) %>
<%= link_to "erase", comment, method: :delete, id:"",
data: { confirm: "You sure?" },
title: comment.content %>
<% end %>
</span>
</span>
</span>
我的帖子也有同样的问题
微博/_micropost:
<span class="timestamp">Posted
<%=time_ago_in_words(micropost.created_at) %> ago.</span>
<%= render 'shared/delete_micropost', object: micropost %> </span>
<br/>
<%= micropost.content %>
</span>
<%= render micropost.comments %>
共享/删除微贴:
<% if current_user?(object.user) %>
<%= link_to "delete", object, method: :delete, id:"micropost_delete",
data: { confirm: "Remove Post?" },
title: object.content %>
<% end %>