Hi, I am using RESTful nested routes for a project. When I try to make an Ajax call using a named route like in the following example: <%= link_to_remote(''edit'', :url => edit_answer_url(@quiz, question, answer)) %> The URL gets constructed OK, but when I click on the link I get the following error back: Routing error: No route found to match ''/quizzes/1/questions/1/answers/26;edit'' with {:method=>:post} I can''t figure out why that is and how to fix it. The only hunch I have is that the POST is the problem. Isn''t the above URL supposed to map to a GET? Thanks for any help!! Ingo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9/20/06, ingoweiss <ingoweiss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I am using RESTful nested routes for a project. When I try to make an > Ajax call using a named route like in the following example: > > <%= link_to_remote(''edit'', :url => edit_answer_url(@quiz, question, > answer)) %> > > The URL gets constructed OK, but when I click on the link I get the > following error back: > > Routing error: > No route found to match ''/quizzes/1/questions/1/answers/26;edit'' with > {:method=>:post} > > I can''t figure out why that is and how to fix it. The only hunch I have > is that the POST is the problem. Isn''t the above URL supposed to map to > a GET? > > Thanks for any help!! > IngoYes, but you''re posting to it. Either use a normal link, or tell link_to_remote to use GET. -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Remember that with RESTful Routes, the _method matters. On Sep 20, 2006, at 1:55 PM, Rick Olson wrote:> > On 9/20/06, ingoweiss <ingoweiss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> Hi, >> >> I am using RESTful nested routes for a project. When I try to make an >> Ajax call using a named route like in the following example: >> >> <%= link_to_remote(''edit'', :url => edit_answer_url(@quiz, question, >> answer)) %> >> >> The URL gets constructed OK, but when I click on the link I get the >> following error back: >> >> Routing error: >> No route found to match ''/quizzes/1/questions/1/answers/26;edit'' >> with >> {:method=>:post} >> >> I can''t figure out why that is and how to fix it. The only hunch I >> have >> is that the POST is the problem. Isn''t the above URL supposed to >> map to >> a GET? >> >> Thanks for any help!! >> Ingo > > Yes, but you''re posting to it. Either use a normal link, or tell > link_to_remote to use GET. > > -- > Rick Olson > http://weblog.techno-weenie.net > http://mephistoblog.com > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---