Alright, I''ve been doing map.resources routing for a while now, so whatever I''m missing must be something stupid and obvious... Anyone care to help me out? -- routes.rb: # ... map.resources :algorithms, :collection => { :search => :post } do |algorithm| algorithm.resources :snippets end # ... -- snippets_controller.rb class SnippetsController < ApplicationController def show # ... end end -- algorithms_controller.rb class AlgorithmsController < ApplicationController # ... redirect_to algorithm_snippet_url(@algorithm, @snippet) # <- no such method redirect_to snippet_url(@algorithm, @snippet) # <- no such method # ... end -- Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---
> Alright, I''ve been doing map.resources routing for a while now, so > whatever I''m missing must be something stupid and obvious... Anyone > care to help me out?Call rake routes to see all the routes you have declared. That usually makes it obvious what the problem is. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
DHH wrote:>> Alright, I''ve been doing map.resources routing for a while now, so >> whatever I''m missing must be something stupid and obvious... Anyone >> care to help me out? > > Call rake routes to see all the routes you have declared. That usually > makes it obvious what the problem is.Right here, in white on black: algorithm_snippet GET /algorithms/:algorithm_id/snippets/:id {:controller=>"snippets", :action=>"show"} so, given that ... it''s most definitely algorithm_snippet_url(@algorithm, @snippet) ... right? -- Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---
> Right here, in white on black: > > algorithm_snippet > GET > /algorithms/:algorithm_id/snippets/:id > {:controller=>"snippets", :action=>"show"} > > so, given that ... it''s most definitely > algorithm_snippet_url(@algorithm, @snippet) ... right?Yes. Are you running on latest edge? I can''t remember how this worked on 1.2.x. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
DHH wrote:>> Right here, in white on black: >> >> algorithm_snippet >> GET >> /algorithms/:algorithm_id/snippets/:id >> {:controller=>"snippets", :action=>"show"} >> >> so, given that ... it''s most definitely >> algorithm_snippet_url(@algorithm, @snippet) ... right? > > Yes. Are you running on latest edge? I can''t remember how this worked > on 1.2.x.Bah, I just figured it out and it was a stupid mistake. My code was outside a method scope and was therefore being evaluated at the static class level. -- Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Named routes raising nil.rewrite error
- Looking for a good resource on open-uri and FileUtils
- Newbie: Am I looking at the right tool?
- 2 commits - doc/Makefile.am libswfdec-gtk/Makefile.am Makefile.am player/Makefile.am test/Makefile.am
- Branch 'as' - 3 commits - doc/Makefile.am libswfdec-gtk/Makefile.am Makefile.am player/Makefile.am test/Makefile.am