Should work for Rails 4 as well
Merge pull request #57 from jlxw/patch-1

Should work for Rails 4 as well