views:

38

answers:

1

Hello,

I have a mystic problem....

In my routes.rb I have some routes defined and for exemple

resources :projects, :except => [:destroy] do
  get :edit_flyer, :on => :member
  get :guests, :on => :member
end

If I run a rake routes, I get

                     edit_flyer_project GET    /projects/:id/edit_flyer(.:format)                      {:controller=>"projects", :action=>"edit_flyer"}
                         guests_project GET    /projects/:id/guests(.:format)                          {:controller=>"projects", :action=>"guests"}
                                        GET    /projects(.:format)                                     {:controller=>"projects", :action=>"index"}
                               projects POST   /projects(.:format)                                     {:controller=>"projects", :action=>"create"}
                            new_project GET    /projects/new(.:format)                                 {:controller=>"projects", :action=>"new"}
                                        GET    /projects/:id(.:format)                                 {:controller=>"projects", :action=>"show"}
                                project PUT    /projects/:id(.:format)                                 {:controller=>"projects", :action=>"update"}
                           edit_project GET    /projects/:id/edit(.:format)                            {:controller=>"projects", :action=>"edit"}

As you can see, the show action is defined. But in my rails applications, the route show is not defined.

I add this in my application controller just to monitored the routes.

before_filter :zba

def zba
  ActionController::Routing::Routes.named_routes.routes.each do |name, route|
    puts "%20s: %s" % [name, route]
  end
  exit
end

And it appears that the route action is not defined ....

Then, I tryed to clean my routes.rb, like removing all my back namespace, and magically it works.

It seems to be a bug, or I fucking don't know what appened.

Have you any idea how to debug this ? I also tryed to remove plugin/gems. No change.

I run with Rails3.rc with ruby 1.8.7 !

Thanks for your help !

+2  A: 

Try this

resources :projects, :except => [:destroy] do
  member do
    get :edit_flyer
    get :guests
  end
end
fl00r
Thanks for your answer !I finally solved it, but it seems very strange.I my routes.rb, i have 8 matches like match 'install', => 'logs#index'If i add an other match, my show action failed.It seems to be a bug ? or a simple rails limitation ?
Arkan
yes, looks buggy, but I don't really see whole picture
fl00r