add Logs resource
authorTom Clegg <tom@clinicalfuture.com>
Tue, 22 Jan 2013 22:19:25 +0000 (14:19 -0800)
committerTom Clegg <tom@clinicalfuture.com>
Tue, 22 Jan 2013 22:19:25 +0000 (14:19 -0800)
app/assets/javascripts/logs.js.coffee [new file with mode: 0644]
app/assets/stylesheets/logs.css.scss [new file with mode: 0644]
app/controllers/application_controller.rb
app/controllers/logs_controller.rb [new file with mode: 0644]
app/helpers/logs_helper.rb [new file with mode: 0644]
app/models/log.rb [new file with mode: 0644]
config/routes.rb
test/fixtures/logs.yml [new file with mode: 0644]
test/functional/logs_controller_test.rb [new file with mode: 0644]
test/unit/helpers/logs_helper_test.rb [new file with mode: 0644]
test/unit/log_test.rb [new file with mode: 0644]

diff --git a/app/assets/javascripts/logs.js.coffee b/app/assets/javascripts/logs.js.coffee
new file mode 100644 (file)
index 0000000..7615679
--- /dev/null
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
diff --git a/app/assets/stylesheets/logs.css.scss b/app/assets/stylesheets/logs.css.scss
new file mode 100644 (file)
index 0000000..4aaccac
--- /dev/null
@@ -0,0 +1,3 @@
+// Place all the styles related to the Logs controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
index 8be24904e1fa16cfa508ac5a8847bdd399e6b12a..95707e7411b4de34f2f434fa02920b18023238bf 100644 (file)
@@ -43,12 +43,18 @@ class ApplicationController < ActionController::Base
 
   def index
     @objects ||= model_class.all
+    respond_to do |f|
+      f.json { render json: @objects }
+    end
   end
 
   def show
     if !@object
       render_not_found("object not found")
     end
+    respond_to do |f|
+      f.json { render json: @object }
+    end
   end
 
   protected
diff --git a/app/controllers/logs_controller.rb b/app/controllers/logs_controller.rb
new file mode 100644 (file)
index 0000000..0beaf56
--- /dev/null
@@ -0,0 +1,2 @@
+class LogsController < ApplicationController
+end
diff --git a/app/helpers/logs_helper.rb b/app/helpers/logs_helper.rb
new file mode 100644 (file)
index 0000000..99736f0
--- /dev/null
@@ -0,0 +1,2 @@
+module LogsHelper
+end
diff --git a/app/models/log.rb b/app/models/log.rb
new file mode 100644 (file)
index 0000000..3e3e7d8
--- /dev/null
@@ -0,0 +1,2 @@
+class Log < OrvosBase
+end
index 04c0e218e530ebc3394f558e84924eacf4027abe..8e2cb6c283b4d78b422081f3d8df0de575cc9982 100644 (file)
@@ -1,4 +1,7 @@
 Vcffarm::Application.routes.draw do
+  resources :logs
+
+
   resources :factory_jobs
 
 
diff --git a/test/fixtures/logs.yml b/test/fixtures/logs.yml
new file mode 100644 (file)
index 0000000..c63aac0
--- /dev/null
@@ -0,0 +1,11 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined.  If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+#  column: value
diff --git a/test/functional/logs_controller_test.rb b/test/functional/logs_controller_test.rb
new file mode 100644 (file)
index 0000000..bab4469
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class LogsControllerTest < ActionController::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end
diff --git a/test/unit/helpers/logs_helper_test.rb b/test/unit/helpers/logs_helper_test.rb
new file mode 100644 (file)
index 0000000..c165554
--- /dev/null
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class LogsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/log_test.rb b/test/unit/log_test.rb
new file mode 100644 (file)
index 0000000..f2afee2
--- /dev/null
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class LogTest < ActiveSupport::TestCase
+  # test "the truth" do
+  #   assert true
+  # end
+end