Ok.  I am using the rails 3 jQuery fork.

Michael

class LanguagesController < SecureController
  before_filter :clear_page_status
  
  active_scaffold :Language do | config |
    config.columns.exclude :app_item_texts, :defaulting_users, 
:translation_language
    config.columns[:translations].association.reverse = :row

    infer_validations config

    config.columns.each { | c | c.weight = 1000 }
    config.columns[:iso_code].weight = 100
    config.columns[:english_description].weight = 200
    config.columns[:local_description].weight = 300
    config.columns[:enabled].weight = 400

    config.list.columns.exclude [:updated_at, :created_at, :lock_version, 
:app_item_texts, :defaulting_users, :translations]

    config.list.sorting = {:iso_code => :asc}
  end
end


class Language < ActiveRecord::Base
  validates_lengths_from_database

  has_many :app_item_texts
  has_many :defaulting_users, :foreign_key => "default_language_id", 
:class_name => "User"
  has_many :translations, :as => :row, :dependent => :destroy
  has_many :translation_language, :class_name => "Translation"

  validates :iso_code, :presence => true, :uniqueness => true
  validates :local_description, :presence => true
  validates :english_description, :presence => true
  validates :email_subject, :length => {:maximum => 80}
end

class Translation < ActiveRecord::Base
  validates_lengths_from_database

  belongs_to :row, :polymorphic => true
  belongs_to :language
end






On Mar 2, 2011, at 7:45 AM, Sergio Cambra .:: entreCables S.L. ::. wrote:

> On Miércoles, 2 de Marzo de 2011 03:16:48 Michael Latta escribió:
>> I have a model that is associated to another model.  The reverse
>> association is polymorphic.  A different association between the two
>> tables matches the name of the parent model.
>> 
>> Language ---- translations ----> Translations
>> Language <--- row ---------------- Translations
>> 
>> Those are the ones I want used so "row" would be hidden as the reverse.
>> 
>> Language <------ lanugage ------ Translations
>> 
>> This is the one that is being hidden (as well as row being hidden).  When
>> other models are in the place of language it is working well.  I set the
>> reverse on the Language model for the translations association to "row"
>> explicitly.
>> 
>> Any suggestions on how to make it show the language association in the
>> subform?
>> 
>> Michael
> 
> Maybe it would be easy to understand with actual models
> 
> -- 
> 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.
> 

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