【发布时间】:2016-08-04 03:54:35
【问题描述】:
我正在做 Rails 应用程序,我将深入研究 Javascript 以了解我的 Web 应用程序的行为,所以这就是问题所在
我有很多帖子的新闻源,帖子中有很多评论隐藏在帖子中
post.css
#comments-section{
display: none;
}
发布/索引“新闻提要”
<%= link_to "Comments", "#", id: "comments-link" %>
<section id="comments-section">
<%= render 'commenters/newsfeedcomment', obj: post %>
<% if current_user == post.user %>
<h6 align="right"><%= link_to 'Edit', edit_post_path(post) %></h6>
<h6 align="right"><%= link_to 'Delete', { :id => post ,:controller => 'posts',:action => 'destroy'} %></h6>
<% end %>
</section>
现在我正在尝试检查我的评论链接以触发但它不起作用,我不知道如何调试
$(document).on "page:change", ->
$('#comments-link').click ->
alert "clicked"
【问题讨论】:
标签: javascript ruby-on-rails coffeescript