Created
July 27, 2014 20:24
-
-
Save tcannonfodder/dc672a6ec6a729316399 to your computer and use it in GitHub Desktop.
Sinatra Boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems'; require 'bundler'; Bundler.require | |
require 'ruby-debug' | |
require "sinatra/reloader" if development? | |
require "dbi" | |
connection = DBI.connect('DBI:Mysql:app_name:localhost', 'root', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-contrib' | |
gem 'debugger', :require => false | |
gem 'mysql' | |
gem 'dbd-mysql' | |
gem 'dbi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not a huge fan of DBI, but it serves the purpose of giving direct access to the database (with prepared statements). The only halfway decent docs are at: http://www.tutorialspoint.com/ruby/ruby_database_access.htm