Skip to content
Browse files

Projects controller

  • Loading branch information...
1 parent 65b37d5 commit 8f71f4fc9c9b4685f0ae1b9d0187c526cf7f7640 @demimismo committed Sep 15, 2012
Showing with 24 additions and 0 deletions.
  1. +23 −0 app/controllers/projects_controller.rb
  2. +1 −0 config/routes.rb
View
23 app/controllers/projects_controller.rb
@@ -0,0 +1,23 @@
+class ProjectsController < ApplicationController
+ respond_to :json
+
+ def index
+ respond_with Project.all
+ end
+
+ def show
+ respond_with Project.find(params[:id])
+ end
+
+ def create
+ respond_with Project.create(params[:project])
+ end
+
+ def update
+ respond_with Project.update(params[:id], params[:project])
+ end
+
+ def destroy
+ respond_with Project.destroy(params[:id])
+ end
+end
View
1 config/routes.rb
@@ -1,6 +1,7 @@
Smokr::Application.routes.draw do
scope "api" do
resources :test_cases
+ resources :projects
end
root to: "main#index"
match '*path', to: 'main#index'

0 comments on commit 8f71f4f

Please sign in to comment.
Something went wrong with that request. Please try again.