Browse files

Merge branch 'master' of heroku.com:simple-ice-37

  • Loading branch information...
2 parents 6e84cc5 + 8330801 commit 0550a59ed2dc3d48c1e907a462c41f8ffe36964b @fd fd committed Jun 22, 2010
View
12 app/controllers/api_controller.rb
@@ -0,0 +1,12 @@
+class ApiController < ApplicationController
+
+ def status
+ users_count = User.count
+ occurences_count = Occurence.count
+ render :json => {
+ :user_count => users_count,
+ :occurence_count => occurences_count
+ }
+ end
+
+end
View
2 app/helpers/api_helper.rb
@@ -0,0 +1,2 @@
+module ApiHelper
+end
View
5 config/routes.rb
@@ -66,5 +66,10 @@
:action => 'index'
map.resources :service_settings
+
+ map.with_options :controller => 'api' do |submap|
+ submap.status '/api/status', :action => 'status'
+ end
+
end
View
8 test/functional/api_controller_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class ApiControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
4 test/unit/helpers/api_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ApiHelperTest < ActionView::TestCase
+end

0 comments on commit 0550a59

Please sign in to comment.