Forum: Ruby on Rails Nested resource

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C85d2f05206272899dc0381f5e572e36?d=identicon&s=25 mark.mcdonald@gmail.com (Guest)
on 2009-01-01 17:56
(Received via mailing list)
Hi!

I am trying to get this to work: it is really close and half way
works.

routes:

map.namespace(:admin) do |admin|
      admin.namespace(:products) do |products|
        products.resources :brains,
          :has_many   =>
[ :pdfs, :images, :firmwares, :specables ]
      end
  end

when I run rake routes i get stuff like:

new_admin_products_brain
edit_admin_products_brain

which is what I expected. however when I try to use this in a form
like such:


<%  form_for([:admin, @product]) do |f| %>

I get an error this error from rails in a from view:

undefined method `admin_product_brain_path' for #<ActionView::Base:
0x20350f0>


Not sure how to fix this, but this is so freggin close it is
painful...

Anyone know the answer?

Happy New Year!
C85d2f05206272899dc0381f5e572e36?d=identicon&s=25 mark.mcdonald@gmail.com (Guest)
on 2009-01-01 17:58
(Received via mailing list)
BTW,

My controller looks like this:

class Admin::Products::BrainsController < Admin::ProductsController
end

as these are all just products...
Hope this makes sense.

On Jan 1, 8:55 am, "mark.mcdon...@gmail.com" <mark.mcdon...@gmail.com>
This topic is locked and can not be replied to.