0

What's the best way to structure a Sinatra app that uses DataMapper? Make a db config file and require it from the main ruby file? How should migrations be handled?

Thanks

conbask
  • 9,741
  • 16
  • 57
  • 94
  • 3
    The padrino framework might be worth a look for your needs. It is built on sinatra and migrating takes a matter of minutes. http://padrinorb.com – Gazler Dec 19 '11 at 20:53
  • 1
    This excellent answer may be of interest to you: http://stackoverflow.com/a/5030173/366051 – Paul Hoffer Dec 19 '11 at 23:37

1 Answers1

2

To keep it simple you can configure your Datamapper settings in the configure block:

configure do
  #some Datamapper settings
end

No need to use extra files unless your project grows big. That's the beauty of Sinatra, everything fits in one file.

three
  • 8,262
  • 3
  • 35
  • 39