# Rails 3 engine plugin's routes not recognized

**URL:** <https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494>\
**Category:** Rails\
**Created:** [February 15, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494 "2010-02-15T16:39:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [February 15, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494/1 "2010-02-15T16:39:52Z")

</div>

Hi, my Rails 3 engine plugin’s routes are not recognized (‘No route  
matches…’) even though they seem to get registered ok (they show up  
in Rails.application.routes) - any idea why anybody?

Thanks!  
Ingo

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [March 1, 2010, 10:34pm UTC](https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494/2 "2010-03-01T22:34:23Z")

</div>

I’m having the same problem. Routes are showing up even when I do  
`rake routes`, but not when the application runs in a server.

ruby 1.9.2-head, both WEBrick and Thin 1.2.7

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [March 1, 2010, 11:34pm UTC](https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494/3 "2010-03-01T23:34:40Z")

</div>

On Mon, Feb 15, 2010 at 6:13 AM, Ingo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi, my Rails 3 engine plugin’s routes are not recognized (‘No route  
> matches…’) even though they seem to get registered ok (they show up  
> in Rails.application.routes) - any idea why anybody?
> 
> Thanks!  
> Ingo

Hi Ingo, what’s the name of the plugin/gem and which routes are not  
being  
displayed?

-Conrad

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [March 2, 2010, 1:31am UTC](https://www.ruby-forum.com/t/rails-3-engine-plugins-routes-not-recognized/183494/4 "2010-03-02T01:31:43Z")

</div>

Interesting. My engine routes are visible to rake, and when I load my  
rails application in a console it appears as if the paths are loading  
(including the routes). Any route I write to a controller in my engine  
fails to work out in the server, however. It doesn’t just fail to  
resolve to the controller, it fails to recognize the route itself.

In my engine:  
#lib/routes.rb  
Rails::Application.routes.draw do |map|  
resources :things, :only =\> [:index]  
end

#lib/thing.rb  
module Thing  
class Engine \< Rails::Engine  
engine\_name :thing  
paths.config.routes = ‘lib/routes.rb’  
end  
end

#app/controllers/things\_controller.rb  
class ThingsController \< ApplicationController  
def index  
render :text =\> ‘Yay I did it’  
end  
end

When I package this as a gem and load it into a bare rails 3 app,  
‘things’ shows up in `rake routes`, but doesn’t actually work.
