On Thu, Nov 10, 2011 at 15:26, Leo M. <li...@ruby-forum.com> wrote: > I have Newspapers that has_many :ads , and :ads belongs to > :newspaper . ... > http://localhost/newspapers/1/ads/1 ... > resources :newspapers do > resources :ads > end ... > No route matches {:controller=>"ads", :action=>"show", :id=>#<Ad id: 1, > product: "an ad", created_at: "2011-11-10 19:54:12", updated_at: > "2011-11-10 19:55:06", newspaper_id: 1>} > > Am I forgetting something?
The route barf should have said :id=>"1" (or at least some number). I think you're somehow passing it a whole ad, rather than an ad ID. Otherwise we wouldn't have the other column in there, like product and the timestamps. The big question is, what did you do to create this error? Did you point a browser at the URL shown above (presumably after telling it to use port 3000)? Or some other, in which case what was it? Or was it an automated test, in which case "post teh codez pls"? If it was via a different URL, then we'll probably need to look at that URL's controller and maybe view. -Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson) -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.