Hi, everyone.

I need to add one more column to ActiveScaffold via association, but here 
is problem: the same column already exists with the same association

Env Rails 2.1.1, ActiveScaffold for Rails 2.1

Basical model

class Context < ActiveRecord::Base
  has_many :descendant_associations, :class_name => 'ContextsRelation', 
:foreign_key => 'ancestor_context_id'
  has_many :descendant_contexts, :through => :descendant_associations, 
:source => :context, :uniq => true

  named_scope :countries, lambda {|*args| 
self.options_for_contexts_filter(COUNTRIES_CONTEXT, args.first == :wi ? 
:country : nil)}
  named_scope :regions, lambda 
{self.options_for_contexts_filter(REGIONS_CONTEXT)}
end

And AS controller:

class Manage::CountryContextsController < ManageAreaController
  active_scaffold :context do |config|
    config.columns[:descendant_contexts].label = 'Countries'
    config.columns[:descendant_contexts].sort_by :method => 
"descendant_contexts.cities.sorted.collect{ |v| v.name }.join(', ')"
    
    config.columns[:descendant_contexts].label = 'Regions'
    config.columns[:descendant_contexts].sort_by :method => 
"descendant_contexts.regions.sorted.collect{ |v| v.name }.join(', ')"
  end
end

How to resolve this issue? I have no idea. For any idea or approaches will 
be very appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/activescaffold/-/Lfm6zPpZmMkJ.
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