Skip to content

Commit 3c984e7

Browse files
committed
Adding rel resource
1 parent d553870 commit 3c984e7

10 files changed

Lines changed: 46 additions & 0 deletions

File tree

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

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"

test/fixtures/api/rels.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2+
3+
one:
4+
slug: MyString
5+
description: MyText
6+
7+
two:
8+
slug: MyString
9+
description: MyText
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class Api::RelsControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

test/unit/api/rel_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class Api::RelTest < ActiveSupport::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test_helper'
2+
3+
class Api::RelsHelperTest < ActionView::TestCase
4+
end

0 commit comments

Comments
 (0)