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
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
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.