Commit a8ccb349

mo khan <mo@mokhan.ca>
2014-01-19 05:42:34
use comments_path helper.
1 parent 770f43a
Changed files (1)
app
views
app/views/shared/_disqus.html.erb
@@ -6,10 +6,8 @@ var disqus_identifier = '<%= id %>';
   var disqus_config = function(){
     this.page.remote_auth_s3 = '<%= disqus_auth %>';
     this.page.api_key = '<%= ENV['DISQUS_API_KEY'] %>';
-    this.callbacks.onNewComment = [function(comment) { 
-      $.post("/comments", { id: comment.id, url: document.URL, comment: comment }, function(result){
-        console.log(result);
-      });
+    this.callbacks.onNewComment = [function(comment) {
+      $.post('<%= comments_path %>', { id: comment.id, url: document.URL, comment: comment }, function(result){ console.log(result); });
     }];
   };
 <% end %>