On Viernes, 28 de Mayo de 2010 19:42:12 Russell escribió:
> My application's data model has a child model that has a large number
> of parent (belongs_to) models.  I'm trying to figure out how to set
> the options differently for different places it will show up embedded
> as a nested scaffold.  Specifically, let's take:
>
> class ParentA
>   has_many :children, :as = :parent
> end
>
> class ParentB
>    has_many :children, :as => :parent
> end
>
> class ParentC
>    has_many :children
>
> class Children
>   belongs_to :parent, :polymorphic => true
>   belongs_to :parent_c
> end
>
> How would I make a scaffold for children that presents one set of
> columns and allows create, edit and update from one model, say
> ParentA, while when displayed as en embed of ParentC, I only want a
> list, no update or create, and different fields.

I'm not sure if you need parent_c assocition, becuase parent is polymorphic.

You can remove children column from create and update actions in parent c 
controller.

I don't understand what you want to say about different fields. Are you talking 
about a nested scaffold?

-- 
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