aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-05-24 11:12:36 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-06 19:34:57 +0100
commit3a7317ea1aaf8e4f9b435299938679a5635783ff (patch)
tree313561abc7653f26eaab1d5411f6c6e4cd06aec4 /app/controllers/request_controller.rb
parentd2e1be54f3e5293fb5291dff7b1f753ddeff3302 (diff)
Redirect numeric request URLs in JSON mode too
URLs such as http://localhost:3000/en/request/106.json should be redirected to the corresponding named URL, including the .json on the end.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index bd2bfc974..07faf4445 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -54,7 +54,7 @@ class RequestController < ApplicationController
# Look up by old style numeric identifiers
if params[:url_title].match(/^[0-9]+$/)
@info_request = InfoRequest.find(params[:url_title].to_i)
- redirect_to request_url(@info_request)
+ redirect_to request_url(@info_request, :format => params[:format])
return
end