wireframe/email_preview — pull request #17 by ronin (2014-02-01 22:55:57+00:00)
Title: created Railtie to fix routing problem, fixes #15

Here is comment to my previous commit.

So I've found out that Rails.application.routes.prepend doesn't actually do anything besides adding associated block to @prepend variable. Blocks in @prepend run when routes.draw is called and this happens before loading gem routes, so gem routes are not prepended at this time. They are also called after changing application routes.rb, which I did when testing this solution.

Now I've created a Railtie which creates initializer prepending application routes. I've tested in two dummy rails applications (4.0.0 and 3.2.16) and in one real application (3.2.12). It would be great if somebody can test it and confirm that it is working ok now.