Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (18 sloc) 0.563 kb
require File.dirname(__FILE__) + '/lib/common.rb'
class MountedApp < Sinatra::Base
set :app_file, __FILE__
set :logging, true
get '/' do
"You created a post, and this is a custom response."
end
mount(Post) do
finder { |model, params| model.all }
record { |model, params| model.first(:id => params[:id]) }
# Mount children as a nested resource
mount(Comment) do
finder { |model, params| model.all }
record { |model, params| model.first(:id => params[:id]) }
end
end
end
MountedApp.run! if __FILE__ == $0
Jump to Line
Something went wrong with that request. Please try again.