Skip to content

Commit

Permalink
Mount API engine correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Dec 6, 2011
1 parent 5545eb6 commit 6ddabd4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ gem 'rails', '3.1.3'
gem 'sqlite3'
gem 'bcrypt-ruby'

gem 'api', :path => './engines/api'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
PATH
remote: ./engines/api
specs:
api (0.0.1)
rails (~> 3.1.3)

GEM
remote: http://rubygems.org/
specs:
Expand Down Expand Up @@ -110,6 +116,7 @@ PLATFORMS
ruby

DEPENDENCIES
api!
bcrypt-ruby
coffee-rails (~> 3.1.1)
jquery-rails
Expand Down
2 changes: 2 additions & 0 deletions app/models/post.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
class Post < ActiveRecord::Base
belongs_to :author, :class_name => "User"

validates :title, :presence => true
end
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Blog::Application.routes.draw do
resources :posts

mount Api::Engine => "/api"

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

Expand Down

0 comments on commit 6ddabd4

Please sign in to comment.