Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Commit

Permalink
Added basic event resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Teese committed Aug 2, 2011
1 parent e4ed137 commit d2c8bf7
Show file tree
Hide file tree
Showing 16 changed files with 193 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BackboneJsAndFullCalendar</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
6 changes: 6 additions & 0 deletions .settings/.jsdtscope
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="public/javascripts"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path=""/>
</classpath>
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.container
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.JRE_CONTAINER
1 change: 1 addition & 0 deletions .settings/org.eclipse.wst.jsdt.ui.superType.name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Global
75 changes: 75 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.9)
actionpack (= 3.0.9)
mail (~> 2.2.19)
actionpack (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.9)
activesupport (= 3.0.9)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activeresource (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.9)
actionmailer (= 3.0.9)
actionpack (= 3.0.9)
activerecord (= 3.0.9)
activeresource (= 3.0.9)
activesupport (= 3.0.9)
bundler (~> 1.0)
railties (= 3.0.9)
railties (3.0.9)
actionpack (= 3.0.9)
activesupport (= 3.0.9)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.8.7)
rdoc (3.6.1)
sqlite3 (1.3.3)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.27)

PLATFORMS
ruby

DEPENDENCIES
rails (= 3.0.9)
sqlite3
5 changes: 5 additions & 0 deletions app/controllers/events_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class EventsController < ApplicationController
def index
render :json => Event.all
end
end
2 changes: 2 additions & 0 deletions app/helpers/events_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module EventsHelper
end
2 changes: 2 additions & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Event < ActiveRecord::Base
end
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ class Application < Rails::Application
config.filter_parameters += [:password]
end
end

ActiveRecord::Base.include_root_in_json = false
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
BackboneJsAndFullCalendar::Application.routes.draw do
resources :events

# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
16 changes: 16 additions & 0 deletions db/migrate/20110802071408_create_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class CreateEvents < ActiveRecord::Migration
def self.up
create_table :events do |t|
t.string :title
t.string :color
t.date :start
t.date :end

t.timestamps
end
end

def self.down
drop_table :events
end
end
24 changes: 24 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20110802071408) do

create_table "events", :force => true do |t|
t.string "title"
t.string "color"
t.date "start"
t.date "end"
t.datetime "created_at"
t.datetime "updated_at"
end

end
20 changes: 20 additions & 0 deletions test/fixtures/events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

one:
title: First booking
color: Red
start: <%= Date.today %>
end: <%= 2.days.from_now %>

two:
title: Second booking
color: Blue
start: <%= 1.day.from_now %>
end: <%= 4.days.from_now %>

three:
title: Third booking
color: Green
start: <%= 6.day.from_now %>
end: <%= 10.days.from_now %>

8 changes: 8 additions & 0 deletions test/functional/events_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class EventsControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
8 changes: 8 additions & 0 deletions test/unit/event_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class EventTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
4 changes: 4 additions & 0 deletions test/unit/helpers/events_helper_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'test_helper'

class EventsHelperTest < ActionView::TestCase
end

0 comments on commit d2c8bf7

Please sign in to comment.