如何构建 Sinatra 应用程序
构建使用 DataMapper 的 Sinatra 应用程序的最佳方式是什么?制作一个 db 配置文件并从主 ruby 文件中需要它?移民应该如何处理?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了简单起见,您可以在配置块中配置 Datamapper 设置:
除非您的项目变大,否则无需使用额外的文件。
这就是 Sinatra 的美妙之处,所有内容都包含在一个文件中。
To keep it simple you can configure your Datamapper settings in the configure block:
No need to use extra files unless your project grows big.
That's the beauty of Sinatra, everything fits in one file.