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.


On Mar 1, 2:32 pm, Conrad Taylor <[email protected]> wrote:
> 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
>
>
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<rubyonrails-talk%2Bunsubscrib 
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to