Forum: Rails Engines Specifying Order for Application & Plugin Routes

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
721cd4ba92bde1922e08870ac2284c67?d=identicon&s=25 Will C. (willclarkdesigns)
on 2009-05-06 21:51
I see that with the latest version of Rails & Engines
the plugin routes are to be moved to plugin_root/config/routes.rb and
Rails will include them.

The problem I'm having is I have a wild card route that I need to be at
the lowest priority of the routes. But I can't seem to see how to load
my plugin's route file last.

I've tried adding in map.from_plugin :my_plugin to the end of
RAILS_ROOT/config/routes.rb but I just get an error:

undefined method '[]' for :my_plugin:Symbol

Am I missing something?

721cd4ba92bde1922e08870ac2284c67?d=identicon&s=25 Will C. (willclarkdesigns)
on 2009-05-06 21:58
I did find one way to make it work, though I'm not sure if this is the
best way to go.

I moved my plugin routes.rb to the root of the plugin, and for the last
line of the application routes file I added:

require "#{RAILS_ROOT}/vendor/plugins/my_plugin/routes"

Is there a better way to do this?
This topic is locked and can not be replied to.