comments_ready = -> $(".comment-reply-to").click -> $("#comment_reply_to_id").val($(this).data("commentId")) $("#comment-reply-msg .comment-reply-author").text($(this).data("commentAuthor")) $("#comment-reply-msg").show() return false $(".comment-reply-cancel").click -> $("#comment_reply_to_id").val("") $("#comment-reply-msg").hide() return false $(document).ready(comments_ready) $(document).on('turbolinks:load', comments_ready)