yogiben / meteor-admin

A complete admin dashboard solution
https://atmospherejs.com/yogiben/admin
GNU General Public License v3.0
826 stars 261 forks source link

Accessing "auxCollection" within Users when editing #324

Open etcook opened 8 years ago

etcook commented 8 years ago

I have added a "groupId" attribute to the User schema, and would like it to be used to generate a populated group dropdown when editing the user. I have it pulling up, but it doesn't populate the options.

My schema definition is:

  groupId:
    type: String
    regEx: SimpleSchema.RegEx.Id
    autoform:
      options: ->
        _.map Groups.find({}).fetch(), (group)->
          label: group.name
          value: group._id
    optional: true

Although I don't think it's relevant, this is my group publication:

Meteor.publishComposite 'groups', ->
  find: ->
    Groups.find()
  children: [
    find: (group) ->
      _id = group.agencyId
      Agencies.find _id: _id
  ]

Any suggestions you might have would be great. Thanks a million for a great package!