rails 4 在development环境下测试发送邮件模板

2015-02-02
阅读 1 分钟
2.6k
首先生成一个mailer 然后配置模板 这个官方手册有。 这里拿devise的用户通知邮件测试: 在/test/mailers/previews/下面创建test文件: {代码...} 这里用了Devise::Mailer来渲染邮件模板 然后我们可以在 /app/views/devise/mailer/下面找到对应的三个模板 修改模板 然后访问路径 {代码...} 就可以看到unlock_instructions...

Rails利用Yaml在不同的环境与数据库之间传递数据

2015-01-15
阅读 2 分钟
107.2k
Sometimes, you cannot just seed your Rails database. This could be due to the complexity of the data itself, which may turn the creation of your seeds.rb file into a pure nightmare. In such cases, one of the possible solutions is to process all your data manually, through your web app UI, for exa...

Rails が production 環境で真っ白、SECRET_KEY_BASE 設定忘れが原因でした

2015-01-13
阅读 1 分钟
3.9k
production 環境で、なぜか Rails アプリケーションの画面が真っ白になってしまった。 — 環境 — Rails 4.1 Unicorn エラーログを確認 unicorn のエラーログを確認しますと… {代码...} production 用の secret_key_base が見つかりません、とエラーメッセージが出ていました。 production 環境の secret_key_base を設定 ...

Failed to build gem native extension

2015-01-09
阅读 1 分钟
2k
Unable to install gem - solution: {代码...} or {代码...}

Building a RESTful API in a Rails Application

2015-01-07
阅读 17 分钟
2.2k
There comes a time in the development lifecycle of most web applications when a third-party integration becomes necessary. One of the simplest ways to do so is to expose a REST API for consumption. This article will walk you through a possible approach to designing and implementing a REST API in ...

Rails 4 + angularjs CORS - 跨域实现的办法

2014-12-30
阅读 2 分钟
12.8k
在两台服务器之间实现angularjs app与rails的REST api通讯,一般会遇到CORS警告的报错。 CORS Cross-origin resource sharing 其实是一种浏览器技术,定义了服务器资源是否允许被另外一个域名下地服务器读取。

关于Rails性能调整

2014-12-27
阅读 13 分钟
2.8k
For something that is touted as being an “easy” to use framework, Rails is a pretty complex beast. Over the years it has progressed from a seemingly simple framework that “anyone” can learn to the intricate collection of add-ons, gems and extensions that make it the power house it is now.

关于rails性能的那些小事儿

2014-12-27
阅读 16 分钟
2.3k
I often hear that Rails is slow. This has become a common theme among the Ruby and Rails community. But it is actually a myth. It's easy to make your application up to 10x faster just by using Rails in the right way. Here's what you need to know to optimize your Rails application.

mac os下使用mysql2报错: rake aborted!

2014-12-04
阅读 1 分钟
2.3k
信息 {代码...} 解决办法 console: {代码...}

Path in developing

2014-12-04
阅读 1 分钟
2.3k
Step by Step 1.Symfony 2.5.* 2.Rails 4.* 3.Meteor 1.* 4.Socket.io / Express.io 5.Angularjs / Backbone.js,underscore.js 6.HTTP protocol