Skip to content

Commit

Permalink
Projects controller
Browse files Browse the repository at this point in the history
  • Loading branch information
demimismo committed Sep 15, 2012
1 parent 65b37d5 commit 8f71f4f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/controllers/projects_controller.rb
Original file line number Original file line Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
Smokr::Application.routes.draw do Smokr::Application.routes.draw do
scope "api" do scope "api" do
resources :test_cases resources :test_cases
resources :projects
end end
root to: "main#index" root to: "main#index"
match '*path', to: 'main#index' match '*path', to: 'main#index'
Expand Down

0 comments on commit 8f71f4f

Please sign in to comment.