If i have a many to many relationship, how can i limit the drop down that assigns a sales agent to an account iin the edit page to display only the sales agents that belong to that user. right now im getting all sales agents for all users my models are as follows.
model: account belongs_to :owner, :class_name => "User", :creator => true has_many :sales_agents, :through => :sales_assignments, :accessible => true has_many :sales_assignments, :dependent => :destroy model sales agent belongs_to :owner, :class_name => "User", :creator => true has_many :accounts, :through => :sales_assignments, :accessible => true has_many :sales_assignments, :dependent => :destroy sales assignment model belongs_to :account belongs_to :sales_agent user model has_many :accounts, :class_name => "Account", :foreign_key => "owner_id" has_many :sales_agents, :class_name => "SalesAgent", :foreign_key => "owner_id" children :accounts, :sales_agents -- You received this message because you are subscribed to the Google Groups "Hobo Users" 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/hobousers?hl=en.
