# Re: Engines 2.3 compatibility

**URL:** <https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072>\
**Category:** Engines\
**Created:** [April 21, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072 "2009-04-21T16:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Klett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Michael\_Klett](https://www.ruby-forum.com/u/Michael_Klett)\
**Post date:** [April 21, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072/1 "2009-04-21T16:34:02Z")

</div>

> If the community feels that controlling the positioning of the routes  
> is necessary, we should be pursuing this as part of the Rails core  
> implementation, i.e. with tickets and patches and +1s.

I have a use-case for needing a catch-all route from a plugin/engine.  
Under  
the native Rails engines implementation, its not possible (without some  
hackery) to install the plugin routes last (or more specifically,  
wherever I  
choose them to be installed).

I agree the place for this is in Rails core, but I wanted to get your  
take  
on my idea of providing a “bundling” and unbundling of routes.

i.e. from a plugin’s routes file:

ActionController::Routing::Routes.bundle(:my\_bundle\_name) do |map|  
map.connect ‘\*path’, :controller =\> ‘whatever’  
end

Then in the main routes file:

map.unbundle :my\_bundle\_name

You could have multiple bundles defined and “stored”, which get inserted  
wherever you choose in the main routes file. I guess this is a lot like  
map.from\_plugin, but it allows for finer grained “chunks” of routes.

Comments welcome!

---

<div class="post-metadata">

**Author:** ![Michael\_Klett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Michael\_Klett](https://www.ruby-forum.com/u/Michael_Klett)\
**Post date:** [April 29, 2009, 1:02pm UTC](https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072/2 "2009-04-29T13:02:51Z")

</div>

On Tuesday 21 April 2009 16:33:07 Michael Klett wrote:

> on my idea of providing a “bundling” and unbundling of routes.
> 
> You could have multiple bundles defined and “stored”, which get inserted  
> wherever you choose in the main routes file. I guess this is a lot like  
> map.from\_plugin, but it allows for finer grained “chunks” of routes.
> 
> Comments welcome!

I’ll be happy if plugin routes could be overwritten with application  
specific  
routes.  
Is there any case where you want to define routes with less precedence  
than  
the routes from the plugin?

---

<div class="post-metadata">

**Author:** ![Michael\_Klett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Michael\_Klett](https://www.ruby-forum.com/u/Michael_Klett)\
**Post date:** [April 29, 2009, 2:50pm UTC](https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072/3 "2009-04-29T14:50:52Z")

</div>

Antonio Tapiador del Dujo wrote:

> > 
> 
> routes.  
> Is there any case where you want to define routes with less precedence than  
> the routes from the plugin?

I can’t think of one off the top of my head, but there’s certainly cases  
where you need to have the plugin order maintained. I have a set of  
full-stack plugins I use for web site design, and the main site info is  
a plugin as well. I need the order to be: Core plugin, Verticals  
plugins, Site plugin, so my core plugin can handle lots of default  
behavior, my verticals can add their functionality, and my site plugin  
can override anything it needs to.

Not sure how best to approach this - I thought the map.from\_plugin was a  
fine solution, not sure how DHH & co feel about adding something like it  
back in, but we need _something_ to handle deconflicting plugin routes.  
The bundle/unbundle semantic above is a nice approach, in that it  
provides everything #from\_plugin provided and more so, and is more  
generic to boot.

+1?

-Rob

---

<div class="post-metadata">

**Author:** ![Michael\_Klett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@Michael\_Klett](https://www.ruby-forum.com/u/Michael_Klett)\
**Post date:** [May 1, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/re-engines-2-3-compatibility/166072/4 "2009-05-01T20:01:09Z")

</div>

Your wish is my command:

[https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/329-add-an-api-for-plugins-to-register-routes](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/329-add-an-api-for-plugins-to-register-routes)  
#ticket-329-20

Please review, test, support or decry as appropriate!

James
