Rails 3 engine plugin's routes not recognized

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

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

On Mon, Feb 15, 2010 at 6:13 AM, Ingo [email protected] 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

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.