summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Legler <a3li@gentoo.org>2012-08-24 21:45:57 +0200
committerAlex Legler <a3li@gentoo.org>2012-08-24 21:45:57 +0200
commite2530f6b284504e7c6bb801f5e2ad9488953836b (patch)
treef2f8015d4cbdd4b130b282a678e9a1f1af93ad0a /app
parentBugs controller: Explicitly render JavaScript using respond_to (diff)
downloadglsamaker-e2530f6b284504e7c6bb801f5e2ad9488953836b.tar.gz
glsamaker-e2530f6b284504e7c6bb801f5e2ad9488953836b.tar.bz2
glsamaker-e2530f6b284504e7c6bb801f5e2ad9488953836b.zip
Comments controller: Explicitly render JavaScript using respond_to
This might be a new 'Feature' or bug. Without this change, the Accept: header of an AJAX request was discarded and text/html returned.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/comments_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index d4aaa27..d3ef31d 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -60,6 +60,11 @@ class CommentsController < ApplicationController
else
@error = "Error: Cannot find GLSA"
end
+
+ respond_to do |format|
+ format.html { render :status => 500 }
+ format.js
+ end
end
def show