Skip to content

Instantly share code, notes, and snippets.

@napcs
Forked from jasim/rails_like_sinatra.rb
Created June 4, 2010 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save napcs/425001 to your computer and use it in GitHub Desktop.
Save napcs/425001 to your computer and use it in GitHub Desktop.
# Main sinatra app
require 'sinatra'
require 'activerecord'
require 'activesupport'
include ActionView::Helpers::DateHelper # add the required helpers here.
require 'controllers.rb'
# controllers.rb
require 'controllers/employee.rb'
require 'controllers/customer.rb'
# controllers/employee.rb
get '/employee' do
#..
end
get '/employee/:id' do
#..
end
get '/employee/:id/edit' do
#..
end
post '/employee/:id' do
#..
end
# controllers/customers.rb
# similar routes here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment