Hi,

I'm trying to configure custom columns for a subform based on it's
parent model.  While I can customize the fields for the child's nested
form, I can figure out how to do this for a subform.

For example, I have STI models and controllers such as:

  User > Employee     #controller employees_controller.rb
  User > Customer     #controller customers_controller.rb
  User > Partner         #controller partners_controller.rb

Then a User has_many :photos. I want to customize the columns and
actions for :photos depending on the parent.

I have both nested forms for photos and a subfrom for photos.  I'm
able congfigure the nested form using a :before_filter in
photos_controller.rb by checking if params[:parent_model] ==
ModelName. However, I can't figure out how to customize the subform on
this basis.

I tried to set config.subform.columns in my before filter, but since
the photos subform doesn't call an action on the photos_controller.rb,
these subform customizations are never being called.  Is there any
other way to specify my custom columns for a subform based on the
parent_model or parent_controller?

Any help would be appreciated! Thanks!

-Rio

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