# Specifying Order for Application & Plugin Routes

**URL:** <https://www.ruby-forum.com/t/specifying-order-for-application-plugin-routes/167342>\
**Category:** Engines\
**Created:** [May 6, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/specifying-order-for-application-plugin-routes/167342 "2009-05-06T21:51:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [May 6, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/specifying-order-for-application-plugin-routes/167342/1 "2009-05-06T21:51:50Z")

</div>

I see that with the latest version of Rails & Engines  
([http://www.rails-engines.org/news/2009/04/20/edge-engines-now-compatible-with-rails-2-3/](http://www.rails-engines.org/news/2009/04/20/edge-engines-now-compatible-with-rails-2-3/))  
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?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![willclarkdesigns](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/85f322/32.png) [@willclarkdesigns](https://www.ruby-forum.com/u/willclarkdesigns)\
**Post date:** [May 6, 2009, 9:58pm UTC](https://www.ruby-forum.com/t/specifying-order-for-application-plugin-routes/167342/2 "2009-05-06T21:58:50Z")

</div>

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?
