created Railtie to fix routing problem, fixes #15 #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.