I’m just getting to the fun part of writing an app, the part where I’m actually writing the app and not just trying to get my environment setup. A couple days ago, I would’ve loved to have found a post that explains how to get Sinatra, Sequel, and RSpec working together plus have all the files organized so that I could just dive in.

If that’s what you’re looking for and all you want to do is get hacking, just download the repo. It provides an example folder structure, migrations, model, helper, routes and specs to help you quickly get started writing your own RESTful app.

Step 2: Hello Sequel

Next, I added in some Sequel. Ryan Tomayko’s sinatra-sequel gem made it a snap. I really like to keep my files small and organized, so I created a config folder for the database configuration and migrations.

Step 4: Hello People

# Migrations will run automatically. The DSL like wrapper syntax is courtesy# of sinatra-sequel## For details on sequel's schema modifications, check out:# http://sequel.rubyforge.org/rdoc/files/doc/schema_rdoc.html
migration "create the people table"do
database.create_table:peopledo
primary_key :idstring:nameendend

This migration will run automatically. Don’t change it after it’s run. More robust up and down ActiveRecord-like migrations are available for Sequel, but since this is a really simple app, really simple migrations will do.

That’s really useful – thanks Rob! I have noticed a bit of a problem setting up the test environment for the specs. You’ve got the “set :environment, :test” in spec_helper.rb, however this gets executed after the configure methods in init.rb run. Therefore the configure :development methods are being run, not the configure :test methods. Any ideas?

This article is very informative but it took me a long time
to find it in google. I found it on 22 spot, you should focus on quality backlinks building, it will help you to increase traffic.
And i know how to help you, just type in google – k2
seo tips and tricks

I read a lot of interesting articles here. Probably you
spend a lot of time writing, i know how to save you a lot of time, there is an online
tool that creates readable, SEO friendly posts in minutes, just search in google
– laranitas free content source