Skip to content

Instantly share code, notes, and snippets.

@tcannonfodder
Created July 27, 2014 20:24
Show Gist options
  • Save tcannonfodder/dc672a6ec6a729316399 to your computer and use it in GitHub Desktop.
Save tcannonfodder/dc672a6ec6a729316399 to your computer and use it in GitHub Desktop.
Sinatra Boilerplate
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', '')
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
gem 'debugger', :require => false
gem 'mysql'
gem 'dbd-mysql'
gem 'dbi'
@tcannonfodder
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment