hey all - wondering if someone would relive my confusion... given a model called say Meeting and a route as "map.resources :meetings" in the console:>>r=ActionController::Routing::Routes >>r.recognize_paths "/meetings"=>{:action="index",:controller=>"meetings"} all works as I expect, but if I do>>r.recognize_paths "/meetings/1"=>{:action="1",:controller=>"meetings"} which is what Id expect for a map.connect, but not for a map.resources similarly>>r.recognize_paths "/meetings/1/new"=>{:action="1",:controller=>"meetings",:id=>"new"} Does recognize_path not work for map.resources, or am I doing something very wrong? thanks Glenn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Heh. I thought I''d pitch in this morning but I get NoMethodError: undefined method `recognize_paths'' for #<ActionController::Routing::RouteSet:0xb787cfb4> I tried recognize_path but it seems to be looking for more information than I''m giving it based on your code there.>> r.recognize_path "/admin/users"ActionController::RoutingError: no route found to match "/admin/users" with {} from ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in `recognize_path'' from (irb):6>> r.recognize_path "admin/users"ActionController::RoutingError: no route found to match "admin/users" with {} from ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in `recognize_path'' from (irb):7>> r.recognize_path "/admin/users/"ActionController::RoutingError: no route found to match "/admin/users/" with {} from ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in `recognize_path'' from (irb):8>> r.recognize_path "/admin/users/new"ActionController::RoutingError: no route found to match "/admin/users/new" with {} from ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in `recognize_path'' from (irb):9 I will say that the results you''re getting aren''t what I''d expect but I can''t seem to manage to make them for myself. RSL On 2/10/07, glenn <glenn-H7U4i/pZ250d9SLi6J12ItHuzzzSOjJt@public.gmane.org> wrote:> > > hey all - wondering if someone would relive my confusion... > > given a model called say Meeting and a route as > "map.resources :meetings" > > in the console: > >>r=ActionController::Routing::Routes > >>r.recognize_paths "/meetings" > =>{:action="index",:controller=>"meetings"} > > all works as I expect, but if I do > >>r.recognize_paths "/meetings/1" > =>{:action="1",:controller=>"meetings"} > > which is what Id expect for a map.connect, but not for a map.resources > similarly > >>r.recognize_paths "/meetings/1/new" > =>{:action="1",:controller=>"meetings",:id=>"new"} > > Does recognize_path not work for map.resources, or am I doing > something very wrong? > > thanks > Glenn > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sorry to top post... but it in your case would it be you havent set routes up for this? glenn On Feb 11, 1:26 am, "Russell Norris" <sco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Heh. I thought I''d pitch in this morning but I get > > NoMethodError: undefined method `recognize_paths'' for > #<ActionController::Routing::RouteSet:0xb787cfb4> > > I tried recognize_path but it seems to be looking for more information than > I''m giving it based on your code there. > > >> r.recognize_path "/admin/users" > > ActionController::RoutingError: no route found to match "/admin/users" with > {} > from > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > `recognize_path'' > from (irb):6>> r.recognize_path "admin/users" > > ActionController::RoutingError: no route found to match "admin/users" with > {} > from > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > `recognize_path'' > from (irb):7>> r.recognize_path "/admin/users/" > > ActionController::RoutingError: no route found to match "/admin/users/" with > {} > from > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > `recognize_path'' > from (irb):8>> r.recognize_path "/admin/users/new" > > ActionController::RoutingError: no route found to match "/admin/users/new" > with {} > from > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > `recognize_path'' > from (irb):9 > > I will say that the results you''re getting aren''t what I''d expect but I > can''t seem to manage to make them for myself. > > RSL > > On 2/10/07, glenn <g...-H7U4i/pZ250d9SLi6J12ItHuzzzSOjJt@public.gmane.org> wrote: > > > > > hey all - wondering if someone would relive my confusion... > > > given a model called say Meeting and a route as > > "map.resources :meetings" > > > in the console: > > >>r=ActionController::Routing::Routes > > >>r.recognize_paths "/meetings" > > =>{:action="index",:controller=>"meetings"} > > > all works as I expect, but if I do > > >>r.recognize_paths "/meetings/1" > > =>{:action="1",:controller=>"meetings"} > > > which is what Id expect for a map.connect, but not for a map.resources > > similarly > > >>r.recognize_paths "/meetings/1/new" > > =>{:action="1",:controller=>"meetings",:id=>"new"} > > > Does recognize_path not work for map.resources, or am I doing > > something very wrong? > > > thanks > > Glenn--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s why I used "/admin/users" as a path [something I _do_ have a path for in my routing] instead of what you were using. ;) If you look at that empty hash there, that''s the problem. It''s looking for a params hash most likely but I haven''t mucked around in the source looking for documentation so I can''t tell for sure. RSL On 2/10/07, glenn <glenn-H7U4i/pZ250d9SLi6J12ItHuzzzSOjJt@public.gmane.org> wrote:> > > sorry to top post... but it in your case would it be you havent set > routes up for this? > > glenn > > On Feb 11, 1:26 am, "Russell Norris" <sco...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Heh. I thought I''d pitch in this morning but I get > > > > NoMethodError: undefined method `recognize_paths'' for > > #<ActionController::Routing::RouteSet:0xb787cfb4> > > > > I tried recognize_path but it seems to be looking for more information > than > > I''m giving it based on your code there. > > > > >> r.recognize_path "/admin/users" > > > > ActionController::RoutingError: no route found to match "/admin/users" > with > > {} > > from > > > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > > `recognize_path'' > > from (irb):6>> r.recognize_path "admin/users" > > > > ActionController::RoutingError: no route found to match "admin/users" > with > > {} > > from > > > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > > `recognize_path'' > > from (irb):7>> r.recognize_path "/admin/users/" > > > > ActionController::RoutingError: no route found to match "/admin/users/" > with > > {} > > from > > > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > > `recognize_path'' > > from (irb):8>> r.recognize_path "/admin/users/new" > > > > ActionController::RoutingError: no route found to match > "/admin/users/new" > > with {} > > from > > > ./script/../config/../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1299:in > > `recognize_path'' > > from (irb):9 > > > > I will say that the results you''re getting aren''t what I''d expect but I > > can''t seem to manage to make them for myself. > > > > RSL > > > > On 2/10/07, glenn <g...-H7U4i/pZ250d9SLi6J12ItHuzzzSOjJt@public.gmane.org> wrote: > > > > > > > > > hey all - wondering if someone would relive my confusion... > > > > > given a model called say Meeting and a route as > > > "map.resources :meetings" > > > > > in the console: > > > >>r=ActionController::Routing::Routes > > > >>r.recognize_paths "/meetings" > > > =>{:action="index",:controller=>"meetings"} > > > > > all works as I expect, but if I do > > > >>r.recognize_paths "/meetings/1" > > > =>{:action="1",:controller=>"meetings"} > > > > > which is what Id expect for a map.connect, but not for a map.resources > > > similarly > > > >>r.recognize_paths "/meetings/1/new" > > > =>{:action="1",:controller=>"meetings",:id=>"new"} > > > > > Does recognize_path not work for map.resources, or am I doing > > > something very wrong? > > > > > thanks > > > Glenn > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---