Skip to content

Commit 3866a79

Browse files
committed
merged rails3
2 parents 01caef8 + 3c984e7 commit 3866a79

14 files changed

Lines changed: 67 additions & 5 deletions

File tree

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ gem 'sqlite3'
55
gem 'json'
66

77
gem 'haml'
8+
gem 'mongo_mapper'
9+
gem 'bson_ext'
810

911
# Gems used only for assets and not required
1012
# in production environments by default.
@@ -23,4 +25,4 @@ group :development, :test do
2325
gem 'fabrication'
2426
gem 'rspec-rails'
2527
gem 'cucumber-rails'
26-
end
28+
end

Gemfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ GEM
3232
multi_json (~> 1.0)
3333
arel (2.2.1)
3434
bcrypt-ruby (2.1.4)
35+
bson (1.3.1)
36+
bson_ext (1.3.1)
3537
builder (3.0.0)
3638
capybara (1.0.1)
3739
mime-types (>= 1.16)
@@ -81,8 +83,16 @@ GEM
8183
mime-types (~> 1.16)
8284
treetop (~> 1.4.8)
8385
mime-types (1.16)
86+
mongo (1.3.1)
87+
bson (>= 1.3.1)
88+
mongo_mapper (0.9.1)
89+
activemodel (~> 3.0)
90+
activesupport (~> 3.0)
91+
plucky (~> 0.3.8)
8492
multi_json (1.0.3)
8593
nokogiri (1.5.0)
94+
plucky (0.3.8)
95+
mongo (~> 1.3)
8696
polyglot (0.3.2)
8797
rack (1.3.2)
8898
rack-cache (1.0.2)
@@ -161,12 +171,14 @@ PLATFORMS
161171
ruby
162172

163173
DEPENDENCIES
174+
bson_ext
164175
coffee-rails (~> 3.1.0.rc)
165176
cucumber-rails
166177
fabrication
167178
haml
168179
jquery-rails
169180
json
181+
mongo_mapper
170182
rails (= 3.1.0.rc6)
171183
rspec-rails
172184
sass-rails (~> 3.1.0.rc)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the API::Rels controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Api::RelsController < ApplicationController
2+
end

app/helpers/api/rels_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module Api::RelsHelper
2+
end

app/models/rel.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Rel
2+
include MongoMapper::Document
3+
4+
key :slug, String
5+
key :description, String
6+
end
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
%h1 API Home!
1+
%h1 Welcome to the Hackety Hack API!
2+
3+

config/application.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class Application < Rails::Application
2121

2222
config.generators do |g|
2323
g.template_engine :haml
24-
g.test_framework :rspec, :fixture => true
25-
g.fixture_replacement :fabrication
2624

2725
# you can also specify a different test framework or ORM here
28-
# g.orm :mongoid
26+
g.test_framework :rspec, :fixture => true
27+
g.fixture_replacement :fabrication
28+
g.orm :mongo_mapper
2929
end
3030
end
3131
end

config/routes.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
constraints(ApiConstraint) do
44
match '/' => 'static#api_root'
5+
scope :module => "Api" do
6+
resources :rels
7+
end
58
end
69

710
root :to => "static#root"

0 commit comments

Comments
 (0)