# Has\_many\_polymorphs\_plugin breaks routes

**URL:** <https://www.ruby-forum.com/t/has-many-polymorphs-plugin-breaks-routes/115797>\
**Category:** Engines\
**Created:** [September 28, 2007, 4:47pm UTC](https://www.ruby-forum.com/t/has-many-polymorphs-plugin-breaks-routes/115797 "2007-09-28T16:47:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_Schofield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Sean\_Schofield](https://www.ruby-forum.com/u/Sean_Schofield)\
**Post date:** [September 28, 2007, 4:47pm UTC](https://www.ruby-forum.com/t/has-many-polymorphs-plugin-breaks-routes/115797/1 "2007-09-28T16:47:19Z")

</div>

Just started playing with Engines (excellent work btw.) Anyways  
everything was working fine in my plugin until I added  
has\_many\_with\_polymorphs plugin into the mix. Then all of a sudden my  
routes are broken.

Everything works fine before adding this plugin and the plugin itself  
works fine in other apps. I’ve also tried forcing engines to load  
first but this doesn’t change the outcome.

Here are the relevant pieces of my logfile. If you want to see it in  
action yourself please see our project website ([railscart.org](http://railscart.org)) and you  
can grab the sourcecode. You will just need to add the  
has\_many\_polymorphs to the starter application.

TIA,

Sean

engines has started.  
e[4;36;1mSQL (0.000000)e[0m e[0;1mSET SQL\_AUTO\_IS\_NULL=0e[0m  
e[4;35;1mSQL (0.000000)e[0m e[0mSELECT version FROM schema\_infoe[0m  
loading plugin from  
./script/…/config/…/vendor/plugins/has\_many\_polymorphs with engine  
additions  
\*\* has\_many\_polymorphs: rails environment detected  
\*\* has\_many\_polymorphs: loaded ok  
Plugin ‘has\_many\_polymorphs’: starting load.  
Plugin ‘has\_many\_polymorphs’: loaded.  
loading routes from  
./script/…/config/…/vendor/plugins/railscart/routes.rb  
\*\* has\_many\_polymorphs: autoload hook invoked  
loading routes from  
./script/…/config/…/vendor/plugins/railscart/routes.rb  
checking plugin ‘acts\_as\_paranoid’ for ‘application\_helper’  
checking plugin ‘engines’ for ‘application\_helper’  
checking plugin ‘has\_many\_polymorphs’ for ‘application\_helper’  
loading from application: application\_helper

Processing ApplicationController#index (for 127.0.0.1 at 2007-09-28  
10:35:23) [GET]  
Session ID: 06f8d68d3bcfb730b0ca982fecfdfe6c  
Parameters: {}

ActionController::RoutingError (no route found to match  
“/admin/categories/list” with {:method=\>:get}):

---

<div class="post-metadata">

**Author:** ![Sean\_Schofield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Sean\_Schofield](https://www.ruby-forum.com/u/Sean_Schofield)\
**Post date:** [October 7, 2007, 3:12am UTC](https://www.ruby-forum.com/t/has-many-polymorphs-plugin-breaks-routes/115797/2 "2007-10-07T03:12:41Z")

</div>

Hi Sean,

The first step would be to figure out why the routing is failing -  
what’s the entry in your routes file that _should_ match  
“/admin/categories/list” ? Do you have a complete sample app  
(including your plugins) that demonstrates this failure?

- James

---

<div class="post-metadata">

**Author:** ![Sean\_Schofield](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/22d042/32.png) [@Sean\_Schofield](https://www.ruby-forum.com/u/Sean_Schofield)\
**Post date:** [October 8, 2007, 1:12am UTC](https://www.ruby-forum.com/t/has-many-polymorphs-plugin-breaks-routes/115797/3 "2007-10-08T01:12:17Z")

</div>

James,

Thanks for the response. I actually got this working yesterday. I  
made several changes to my code to get the tests working and then I  
decided to give HMP another spin and it worked.

The only change that I can think might have fixed this was adding my  
plugins lib dir to the LOADPATH with

Rails.plugins[:railscart].code\_paths \<\< “lib”

I don’t know how this would have fixed things since my lib code is  
completely unrelated to HMP. In fact, I wasn’t even referencing HMP  
in my code yet (just trying to add it to my project and start it up.)

In any event. Its working now. Nice work on the engines plugin. I  
think it will be ideal for our project.

You asked about sample code. Its actually an open source shopping  
cart and there is a basic sample app in place ([http://railscart.org](http://railscart.org).)  
We’re also looking for some more volunteers to help with coding if the  
project sounds interesting to you.

Regards,

Sean
