摘要:
The Purpose of the Rails RouterThe Rails router recognizes URLs and dispatches them to a controller’s action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.1.1 Connecting URLs to CodeWhen your Rails application receives an incoming requestGET /patients/17it 阅读全文
摘要:
Using MongoMapper with Rails 3 is easier than ever. Thanks to new features in ActiveSupport, and the new ActiveModel framework (which MongoMapper 0.9+ uses), your app can be up and running on MongoDB in a matter of seconds.First, if you’re generating a new Rails 3 application, it is recommended to l 阅读全文
摘要:
一、准备工作1、 下载mongoDB下载地址:http://www.mongodb.org/downloads选择合适你的版本相关文档:http://www.mongodb.org/display/DOCS/Tutorial2、 安装mongoDBA、 不解压模式:将下载下来的mongoDB-xxx.zip打开,找到bin目录,运行mongod.exe就可以启动服务,默认端口27017,db保存的路径是系统C硬盘目录的根目录的/data/db目录。也就是说,如果你的mongoDB-xxx.zip在E盘,那么你需要在C盘下建立data/db目录。mongoDB不会帮你建立这个目录的。然后运行mo 阅读全文