I feel like I''m doing something stupid, because I haven''t been able to fix this. I have this in my routes.rb file: map.resources :networks, :has_many => :nodes map.resources :auth map.connect ''users/login'', :controller => ''users'', :action => ''login'' map.resources :users map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' I''m trying to generate an url that goest to localhost:3000/users/ login .... but no matter what I do, that url always tries to work through the "show" action as opposed to the "login" action I have in the users controller. What am I doing wrong? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Why should that work? Routes are consulted in the order they are defined in routes.rb. So if you have map.resources :users before map.connect ''/users/login'' it will catch the ''/users/:id'' declaration of the RESTful resource routes and always get justin to the show action before it even reaches the ''/users/login'' declaration. dirk. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thats right. the order is from top to bottom. It was my mistake. On Jul 25, 5:33 pm, deegee <dirkgro...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Why should that work? Routes are consulted in the order they are > defined in routes.rb. So if you have > map.resources :users > before > map.connect ''/users/login'' > it will catch the ''/users/:id'' declaration of the RESTful resource > routes and always get justin to the show action before it even reaches > the ''/users/login'' declaration. > > dirk.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---