On 13 September 2011 22:47, Romain 'Maz' BILLOIR <[email protected]> wrote: > Hi everyone, I'm having some troubles with RoR and REStful > controllers: > > I generated a simple scaffold "categories" wich contains name and > branch column: easy. > I also generated a namespaced controller "admin/categories". > I replaced all the scaffold's link_path in my views to match with my > admin namespace, such as "<%= link_to 'Show', @category %>" became "< > %= link_to 'Show', [:admin, @category] %> ". > I replace the resource routes with my namespace: > > namespace :admin do > resources :categories > end > > And everything works fine... Until I created a resource in my database > using scaffold forms... Now when I'm going to "mywebsite/admin/ > categories", rails is trying to render show method: > No route matches {:action=>"show", :controller=>"admin/categories"}
When you say that it is trying to *render* the show method do you mean that is during running the index action? Is the render being invoked from the index action? Have a look in the rails log. If you can't see what is happening then post the log starting with what happens when you click the link. You also might like to have a look at the rails guide on debugging. That will show you how to use ruby-debug to break into your code and see what is going on. So you can break into the index action (assuming it is getting there) and inspect data and follow the flow to see what is happening. Colin -- gplus.to/clanlaw -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

