Dear Railsfolks, I''ve got some simple mappings (pasted below). However, given the below mappings this url *should* work: http://localhost/see/10/99 where ''10'' would become the :id and ''99'' would be the :eid. However I get an error message stating that ''no action responds to 10''. Ouch. Ideas? All of my other mappings seem to be working fine ... Any help would be appreciated. ... map.connect ''site/:action/:id/:eid'', :controller => ''site'' map.connect ''elements/edit/:site_id/:id'', :controller => ''elements'', :action => ''edit'' map.connect ''elements/delete/:site_id/:id'', :controller => ''elements'', :action => ''delete'' map.connect ''see/:id'', :controller => ''see'', :action => ''index'' map.connect ''see/:id/:eid'', :controller => ''see'', :action => ''index'' map.connect '':controller/service.wsdl'', :action => ''wsdl'' # default root map.connect '':controller/:action/:id'' map.connect '''', :controller => "home" map.connect '':indexword'', :controller => ''see'', :action => ''index'' ...
On Jun 27, 2005, at 12:47 AM, Greg McClure wrote:> Dear Railsfolks, > > I''ve got some simple mappings (pasted below). > > However, given the below mappings this url *should* work: > > http://localhost/see/10/99 > > where ''10'' would become the :id and ''99'' would be the :eid. However I > get an error message stating that ''no action responds to 10''. > > Ouch. > > Ideas? All of my other mappings seem to be working fine ... > > Any help would be appreciated. > > ... > map.connect ''site/:action/:id/:eid'', :controller => ''site'' > > map.connect ''elements/edit/:site_id/:id'', :controller => ''elements'', > :action => ''edit'' > map.connect ''elements/delete/:site_id/:id'', :controller => ''elements'', > :action => ''delete'' > > map.connect ''see/:id'', :controller => ''see'', :action => ''index'' > map.connect ''see/:id/:eid'', :controller => ''see'', :action => ''index'' > > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > > # default root > map.connect '':controller/:action/:id'' > > map.connect '''', :controller => "home" > > map.connect '':indexword'', :controller => ''see'', :action => ''index'' > ... > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Try putting this route : map.connect ''site/:action/:id/:eid'', :controller => ''site'' Below this one: map.connect ''see/:id/:eid'', :controller => ''see'', :action => ''index'' I think that since the site/:action/:id/:eid is above the other one, it thinks that 10 is the action. Re-arange them and IO think it should work then, Cheers- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732
Thanks, Ezra, for responding, it''s very appreciated. But why would the ''site/:action/:id/:eid'' route match? It begins with ''site'' and this mapping is failing for all urls beginning with ''see'', which is explicitly matched in my mapping. In any case, I tried it and it didn''t work. I''m using the latest Rails (did an update a few days ago), and Ruby 1.8.2. This is very confusing. It feels like a bug in the framework. Please Help!!> Try putting this route : map.connect > ''site/:action/:id/:eid'', :controller => ''site'' > Below this one: map.connect ''see/:id/:eid'', :controller => > ''see'', :action => ''index'' > I think that since the site/:action/:id/:eid is above the other one, > it thinks that 10 is the action. Re-arange them and IO think it > should work then,
Ezra, Thanks again! Tried it, though, didn''t work. Oddly, when I change the mapping to: map.connect ''see/index/:id/:eid'', :controller => ''see'', :action ''index'' *that* works. Of course, I have to change the url links in the associated view to match it, like so, http://<host>/see/index/<some-id>/<some-eid> But then everything will work okay. Unfortunately, I would really, really like the URL to exclude the ''index'' part ... On 6/27/05, Ezra Zygmuntowicz <ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org> wrote:> Duh- I totally misread that site as see and just copy/pasted my > answer. I appologize. One more thinng you could try is to be more > verbose about it. Like so: > > map.connect ''see/:id/:eid'', :controller => ''see'', > :action => ''index'', > :id => ''id'', > :eid => ''eid'', > :requirements => > { :id => /\d/ . > > :eid => /\d/ }, > > Hope that helps- > Ezra > > On Jun 27, 2005, at 10:17 AM, Greg McClure wrote: > > > Thanks, Ezra, for responding, it''s very appreciated. > > > > But why would the ''site/:action/:id/:eid'' route match? It begins with > > ''site'' and this mapping is failing for all urls beginning with ''see'', > > which is explicitly matched in my mapping. > > > > In any case, I tried it and it didn''t work. > > > > I''m using the latest Rails (did an update a few days ago), and Ruby > > 1.8.2. > > > > This is very confusing. It feels like a bug in the framework. > > > > Please Help!! > > > > > > > >> Try putting this route : map.connect > >> ''site/:action/:id/:eid'', :controller => ''site'' > >> Below this one: map.connect ''see/:id/:eid'', :controller => > >> ''see'', :action => ''index'' > >> I think that since the site/:action/:id/:eid is above the other one, > >> it thinks that 10 is the action. Re-arange them and IO think it > >> should work then, > > > > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > 509-577-7732 > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > >