diff options
-rw-r--r-- | app/controllers/general_controller.rb | 10 | ||||
-rw-r--r-- | config/routes.rb | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index a8bbc22ff..626c4ad87 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -230,6 +230,14 @@ class GeneralController < ApplicationController render(:layout => false, :content_type => 'text/css') end - + def version + respond_to do |format| + format.json { render :json => { + :alaveteli_git_commit => alaveteli_git_commit, + :alaveteli_version => ALAVETELI_VERSION, + :ruby_version => RUBY_VERSION + }} + end + end end diff --git a/config/routes.rb b/config/routes.rb index 3512b4cd4..8d6704a9e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,7 @@ ActionController::Routing::Routes.draw do |map| general.advanced_search '/advancedsearch', :action => 'search_redirect', :advanced => true general.random_request '/random', :action => 'random_request' + general.version '/version.:format', :action => 'version' end map.with_options :controller => 'request' do |request| |