On Sábado, 5 de Junio de 2010 22:06:33 Andrés Mejía escribió:
> Hi,
>
> I'm facing the following problem.
>
> I have a Product and a Category model. A Product
> has_and_belongs_to_many Categories and viceversa.
> I've set up an ActiveScaffold for each of them under an Admin
> namespace.
>
> Everything works perfectly, except for the association between them.
> When I'm on a Product's scaffold, I can see the Categories associated
> with it correctly. But when I try to add a new one, I get a routing
> error. Here a series of images to further clarify what I mean:

Add :active_scaffold => true to your routes.rb for each map.resources line

>
> Step 1. I can see the product's scaffold with the categories it is
> associated with, on localhost:3000/admin/products. I'll click the link
> to edit its category:
> http://img.skitch.com/20100605-mm8yiwsrb476e46f212if3irfy.png
>
> Step 2. A little box for the category appears. I'll click the link to
> add a new category:
> http://img.skitch.com/20100605-mbnynqr48a6d691wymf93fbe8a.png
>
> Step 3. An exception is raised!
> http://img.skitch.com/20100605-g9rfd1rwjt9f1qprsximc1qn36.png
>
> Looking at the log, the exception raised is the following:
>
> ActionController::RoutingError (No route matches "/categories/new"
> with {:method=>:get})
>
> This is indeed true, because I don't have any route for that. The
> problem is that it should really be calling "admin/categories/new".
>
> Here are the relevant parts of my code:
>
> http://gist.github.com/426955
>
> I'd really appreciate if someone could take the time to help me solve
> this.
>
> Thanks!

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.

Reply via email to